Mailing List Archive

Adding to Cart
Hello,
 
I am working on adding a fee to the cart if the customer doesn't reach a certain price threshold. I've noticed that additions to cart are done through a form on the fly pages and elsewhere on the site, but it wouldn't make sense in this specific use case.
 
My question is, can I add an item directly to the "Items" array and have it display in the cart? What I have in mind is something like this, but I'm not sure if it's possible:
 
[if-item-field vendor eq "..."]
   [perl] push(@Items, fee); [/perl]
[/if-item-field]

Thank you in advance.

______________________

Mihai Dan
Air Delights, Inc.
https://www.airdelights.com
1 (800) 440-5556

_______________________________________________
interchange-users mailing list
interchange-users@interchangecommerce.org
https://www.interchangecommerce.org/mailman/listinfo/interchange-users
Re: Adding to Cart [ In reply to ]
On Wed, 6 Jan 2021, mihai@airdelights.com wrote:

> My question is, can I add an item directly to the "Items" array and have
> it display in the cart? What I have in mind is something like this, but
> I'm not sure if it's possible:
>
> [if-item-field vendor eq "..."]
>    [perl] push(@Items, fee); [/perl]
> [/if-item-field]

Yes, that has been done many times.

Though of course instead of "fee" you need to have the data structure of a
cart line item.

Jon


--
Jon Jensen
End Point Corporation
https://www.endpoint.com/