[ic] Shipping charge getting "stuck"
Gert van der Spoel
gert at 3edge.com
Sun Aug 12 15:26:28 EDT 2007
> -----Original Message-----
> From: interchange-users-bounces at icdevgroup.org [mailto:interchange-
> users-bounces at icdevgroup.org] On Behalf Of DB
> Sent: zondag 12 augustus 2007 21:58
> To: interchange-users at icdevgroup.org
> Subject: [ic] Shipping charge getting "stuck"
>
> >> I'm running 5.4.2 and a modified foundation store. My shipping
> charges
> >> are based on price, but I have several virtual items for which I do
> not
> >> want to charge any shipping.
> >>
> >> I assigned these virtual items a weight of zero in the products
> table,
> >> and I thought the following code added to
> >> include/checkout/shopping_cart
> >> would do the trick
> >>
> >> [if type=explicit compare="[summary format='%s' total=1]"]
> >> [comment]do nothing[/comment]
> >> [else]
> >> [assign shipping=0]
> >> [/else]
> >> [/if]
> >>
> >> This does work, however if a non-virtual item is then added to the
> >> cart,
> >> the shipping remains at zero instead of getting calculated by price.
> >
> > How do you know that it 'works' ? Does the if perhaps always return
> > true/false (as in always the comment or always doing the assign?)
> > Have you tried have this 'if' return some debug data to know for sure
> that
> > it goes into the if/else correctly.
> > Perhaps your compare always returns the same (incorrect) value, but
> it
> > appears correct for the zero weight and not for the others.
> >
> >> Why does the shipping get "stuck" at zero, even after the total
> weight
> >> of the items in the cart becomes non-zero? Can anyone suggest a
> >> solution?
> >
> > Can't you add a line to the shipping.asc which says that an order
> with 0
> > weight has 0 shipping cost?
> >
> > CU,
> >
> > Gert
>
> Yes, I did use some debugging display text to verify that the if/else
> is
> working properly. There's just something odd about the shipping charge
> getting "stuck" which I don't understand. Once the shipping gets set to
> zero once, it stays there no mater what I put in the cart. Once stuck,
> I
> have to close the browser and re-enter the site to get it to show
> something other than zero for shipping.
>
> Can you give me and example of a line for shipping.asc that would do
> what you suggest?
http://www.interchange.rtfm.info/icdocs/tags/assign.html#shipping
"The assignment is persistent within a user's session until you clear it, an
assigned tag will return your value instead of calculating a value."
[assign clear=1] in your 'if' part could do the trick (unless you are using
assign for other things as well that would then also be cleared).
As for the weight 0 to have 0 shipping, in my shipping.asc I have the
following:
FPSR_GRE First Priority weight 0 0 e Nothing to ship!
I'd think that you could change the e Nothing to ship! To something else,
perhaps just 0
CU,
Gert
More information about the interchange-users
mailing list