WPIntell

Source evidence

Fatal error when calling available_variation()

WPC Product Quantity for WooCommerce · support · 2025-11-10T12:35:00+00:00

complaintsentiment
highseverity
0.72relevance
1replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 34 rows with source links

17.6% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

28 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Marc unresolved
Hello, I’ve encountered a fatal error in the current version of WPC Product Quantity Premium. The issue occurs in wpc-product-quantity.php around line 858: Fatal error: Uncaught Error: Call to a member function is_type() on false in /wp-content/plugins/wpc-product-quantity-premium/wpc-product-quantity.php:858 Stack trace: 0 /wp-content/plugins/wpc-product-quantity-premium/wpc-product-quantity.php(876): WPCleverWoopq->get_quantity() 1 /wp-content/plugins/wpc-product-quantity-premium/wpc-product-quantity.php(921): WPCleverWoopq->get_type() 2 /wp-content/plugins/wpc-product-quantity-premium/wpc-product-quantity.php(1850): WPCleverWoopq->get_min() 3 /wp-includes/class-wp-hook.php(324): WPCleverWoopq->available_variation() … The error happens when the method available_variation() is executed in a context where the $product parameter is false or null , so calling $product->is_type() throws a fatal error. The plugin assumes that $product is always an instance of WC_Product , but in some contexts (for example during certain AJAX calls or variation rendering), the woocommerce_available_variation filter can be triggered with an invalid or empty product reference. To prevent the fatal error, a simple instance check should be added before accessing $product methods, e.g.: if ( ! $product instanceof WC_Product ) { return $data; } Suggested fix: Add this validation in the following methods before using $product : get_type() get_min() available_variation() This ensures compatibility with all WooCommerce contexts and prevents fatal errors when $product is not properly initialized. The page I need help with: [ log in to see the link] Hi @crammarc , This forum is for supporting the free versions of our plugins only. Please contact our developers directly at our Support Forum https://wpc.ticksy.com/ for further instructions and help in your case. Best regards.

Comments

1 shown
Janilyn T 2025-11-11T15:03:00+00:00

Hi @crammarc , This forum is for supporting the free versions of our plugins only. Please contact our developers directly at our Support Forum https://wpc.ticksy.com/ for further instructions and help in your case. Best regards.