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.
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 thisif()
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 theif()
block at line 606.Then, the
if()
block at line 606 finishes off using theelse
block (currently line 649) setting$proceed
to true.