[ic] Discount problem

Ed LaFrance interchange-users@interchange.redhat.com
Wed May 15 12:38:01 2002


At 11:26 AM 05/15/2002 -0500, you wrote:
>Well, I'm still having trouble with this.  I've tried several different 
>things.
>Below is the most current code.  In my previous posts on this subject, I
>neglected to mention that the discounts weren't being calculated right.  I 
>have
>corrected that problem now.  The discounts are supposed to be stacked meaning
>that a discount is applied to the total and then another discount is 
>applied to
>the discounted total.  In other words, the percentages aren't applied to the
>original total (the total of the order before any discounts) unless only one
>discount has been selected.
>
>Anyway, the problem is that when the checkout form gets refreshed the newly
>discounted total isn't displayed right away.  For example, let's say the order
>total is $1,000.  If a 10% discount is selected (please see code below), the
>displayed total should be $900 after the checkout form gets 
>refreshed.  Instead,
>the total shown is $1,000.  If I refresh the checkout page again the correct
>total of $900 is shown.  This same problem happens again as additional 
>discounts
>are selected.  Also, I'd imagine that an incorrect total would be shown on the
>receipt page if the order were finalized without refreshing the checkout 
>page a
>second time first.  Speaking of recalculating the order, the correct order 
>total
>will also be displayed if I go to another page and then come back to the
>checkout or basket page.  Could someone please tell me what I am doing wrong
>here?  I'm sure that my code could be greatly improved and simplified.
>
>[del of big nasty mess]

Ugh. One thing you are doing wrong is posting unreadable masses of 
characters, then asking people to try to make sense of it -  don't expect 
much help unless you code is formatted for some semblance of readability.

Where is the actual code which applies the discount in relation to the cart 
display. If it is below the cart, that is your problem; move it up above 
the cart and you will see the discount without that second refresh.

- Ed L.


===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================