cubecart / v6

CubeCart Version 6
https://cubecart.com
72 stars 59 forks source link

Unknown Variable #3460

Open bhsmither opened 8 months ago

bhsmither commented 8 months ago

In Cart->discountAdd(), near line 606, starts tests to determine if a coupon has products assigned and whether the coupon is allowed or disallowed accordingly.

It is within the if() block at line 606 where $qualifying_products and $incexc makes their first appearance. Should this if() block fail to execute, these variables will not be set.

Then, within the if() block at line 618, these variables are used but may not exist. PHP may complain about this (but I have not yet verified).

Because the if() block from lines 618-648 really are only applicable if, first, $coupon['product_id'] is not empty, perhaps those lines of code (618-648) could be moved just above the closing brace (line 616} of the if() block at line 606.

Then, the if() block at line 606 finishes off using the else block (currently line 649) setting $proceed to true.

abrookbanks commented 8 months ago

Thanks.

abrookbanks commented 4 months ago

This commit has screwed up tax calculations. :(