[ic] Weirdness with discount tag

Andrew Rich andrew at mapsdownunder.com.au
Wed Nov 19 00:47:32 EST 2003



> -----Original Message-----
> From: interchange-users-bounces at icdevgroup.org
> [mailto:interchange-users-bounces at icdevgroup.org]On Behalf Of Joshua
> Lavin
> Sent: Tuesday, 18 November 2003 10:09 AM
> To: interchange-users at icdevgroup.org
> Subject: Re: [ic] Weirdness with discount tag
>
>
>
> On Monday, November 17, 2003, at 04:02  PM, Ed LaFrance wrote:
>
> > At 02:44 PM 11/17/2003 -0600, you wrote:
> >> IC 4.9.8-20030915
> >>
> >> The shopping cart is not displaying the correct price-each or
> >> subtotal when using discounts if you order more than 1
> item. It works
> >> fine as long as the quantity is 1, but when it is 2 or more, the
> >> discounted price-each gets divided by the quantity, and
> the subtotal
> >> equals that times the quantity (correct behavior).
> >>
> >> The discount is applied on the flypage, and is to equal
> the SalePrice
> >> field in my database:
> >> [discount [item-code] interpolate=1]
> >> my $t = [item-field SalePrice];
> >> return $t;
> >> [/discount]
> >>
> >> The cart is using:
> >> [if discount [item-code]]
> >> [discount-price] (for price-each)
> >> [item-discount-subtotal] (for extended price)
> >> [else]
> >> [item-price]
> >> [item-subtotal]
> >> [/else]
> >> [/if]
> >>
> >> I have a test site here:
> >> http://www.shopalert.us/shop_dev/nogreaterjoy.html
> >>
> >> This page has links to the flypages, which apply the discount. For
> >> this particular sale, everything is 25% off, so I've also tried
> >> applying the discount on the flysale-audio.html and
> >> flysale-videos.html pages with:
> >>
> >> [discount [item-code]] $s * .75 [/discount]
> >>
> >> This works if you type in the quantity and then hit "Add
> to cart." It
> >> also works if you order 1 and then change the quantity in the cart
> >> and recalculate. The problem starts if you go back to the
> sale page,
> >> and buy a different item. When the cart comes up, the first item's
> >> price-each equals the discounted price each divided by the
> quantity.
> >>
> >> I am baffled by this. Any suggestions?
> >>
> >> Thanks,
> >> Josh
> >
> > Josh -
> >
> > This worked fine for me...
> >
> > - Ed
>
> Ed,
>
> Thanks for taking a look. Did you happen to use the back button to
> return to the sale page?
>
> After some further testing, I found that buying audio tapes and
> changing quantity in the cart or on the flypage worked. If I used the
> back button to return to the sale page, and added more audio
> tapes, the
> quantities were still fine. It was only when I hit "continue
> shopping"
> or entered the sale page URL in the browser that the discounts got
> messed up.
>
> Maybe I should change "continue shopping" to a javascript history
> thing...
>
> Josh
>
Actually I tried the site yesterday and it failed so have just done it again
to make sure I wasn't dreaming.  I didn't reply to the list as I was not
sure of what to suggest.

Today it took longer to reproduce the error but I could get it to happen in
the following way.

>From sale page select "Authority Praying" (sku: 1000404) product then Add to
Cart.  From Cart press the Back button the select the Return to Sale page
link from lower right.  Select another product like "Only Men: (sku:1000405)
then Add to Cart.

At this point you are in the Cart and both products look ok.  If you change
the quantity of the first product from 1 to 2 then press recalculate the
pricing changes in a way you don't expect.  i.e. it gets much cheaper and
discount goes up totals are incorrect.

Unfortunately I am unable to help any further but I do like what you are
trying to do!

Andrew Rich





More information about the interchange-users mailing list