Forums / Bug Reports / [Done v1.3.9] Duplicate coupon confirmation message

[Done v1.3.9] Duplicate coupon confirmation message

Locked

Started by karma_lab on 18 Jun 2008, 8:48 PM · Views: 2,458

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
18 Jun 2008, 8:48 PM
#1
karma_lab avatar

karma_lab

Zen Follower

Join Date:
Apr 2008
Posts:
135
Plugin Contributions:
0

[Done v1.3.9] Duplicate coupon confirmation message

When checking out, if you enter a valid coupon, tick the "terms and conditions" checkbox, but then click continue before entering the payment information, you will get a duplicate confirmation message (stack message) at the top of the window, as shown in the attached picture.

Likewise, the same thing will happen if you enter the coupon code, enter all the payment information, but do not tick the checkbox for "terms and conditions."

You can repeatedly test the example and variations by typing REMOVE in the coupon box after each attempt.

I performed this example on the default "Classic Green" template to make sure it wasn't anything in my skin.

ZenCart 1.3.8a.

I tried looking into it a bit, and for some reason, it appears that the function collect_posts() includes/modules/order_total/ot_coupon.php is being called twice. If I comment out line 288:

$messageStack->add_session('checkout', TEXT_VALID_COUPON,'success');

...then I get 0 messages.

This I traced to line 163 of includes/classes/order_total.php:

          $GLOBALS[$class]->collect_posts();

...which also, when commented out, removes both messages. So it appears that this line is executing twice, when it should only execute once. But I'm afraid I don't know enough about how zencart is working here to actually fix it.

12 Aug 2009, 11:28 PM
#3
karma_lab avatar

karma_lab

Zen Follower

Join Date:
Apr 2008
Posts:
135
Plugin Contributions:
0

Re: [Done v1.3.9] Duplicate coupon confirmation message

Thanks! I implemented it and it seems to work. :)