Error message on checkout step 2 when using a coupon
I'm getting a fatal error trying to go from step 2 to 3 of checkout when using a coupon that has restrictions. If the coupon has no restrictions, checkout goes fine.
This is the debug message: Uncaught TypeError: validate_for_category(): Argument #1 ($product_id) must be of type int, string given, called in /includes/functions/functions_gvcoupons.php on line 182 and defined in /includes/functions/functions_gvcoupons.php:210
Don't know how to fix that or where to look for whatever's throwing the error. Help is appreciated. Thanks.
Re: Error message on checkout step 2 when using a coupon
You've discovered a big in the software.
Change line 182 from:
Code:
$allow_for_product = validate_for_product($product_id, $coupon_id);
To:
Code:
$allow_for_product = validate_for_product((int)$product_id, $coupon_id);
Please report back the result which may include a similar statement about the coupon_id.
Then take credit for the discovery in the bus section of the forum.
Re: Error message on checkout step 2 when using a coupon
This fixed it. No further errors came up, and the checkout process completed. Thank you!
Re: Error message on checkout step 2 when using a coupon
Spoke too soon. The change also had to be made on line 183. Then there were no further errors. Thanks for your help.
Re: Error message on checkout step 2 when using a coupon
I'll note that this currently occurs if-and-only-if a product with attributes (i.e. there's a string uprid as opposed to a simple products_id) is present in the cart.