I'm having difficulty adding items with quantity=0 to my cart. I'm currently allowing users to go through my store and select various items and then storing their selection as a cookie so that when they return I could build an array of all the items they wanted. However because e-junkie cart also has cookies, i need to keep track of any items that the user has removed since e-junkie's cart last stored it's cookie. Currently, I'm building the url array with either quantity=0 or quantity=1 which are added to each url that are then sent with EJEJC_multiAdd() but the items with quantity=0 are never removed. In fact, if they were never in the cart, items with &quantity=0 in the url are added instead. This seems to be an issue with only zero, as if I add 30 or 50 instead, the quantity in the cart is reciprocated correctly.



Question 1)

Can I really remove items from the cart by adding &quantity=0 to an item's URL via the EJEJC_multiAdd() method call?? if so, how should I be done correctly?



Question 2)

Can I possibly fetch the items that are currently in the user's cart? I think the answere is no. but i figured I'd ask anyways.



Quesiton 3)

Why is it that if I want to use my own cookie to store cart information, setting EJEJC_CDAYS = 0; in EJEJC_config() begins to disallow me from adding more than one item to the cart? Is this a bug? I would really like to be able to disable the e-junkie cart cookie as it will allow me to simply set multiple cart items with the EJEJC_multiAdd() each time they want to see the cart, thus avoiding the &quanity=0 issue all together..

  • created

    Feb '12
  • last reply

    Feb '12
  • 1

    reply

  • 994

    views

  • 2

    users

  • 2

    links

I'm not quite following what you're trying to accomplish beyond the cart's standard functionality of simply having the buyer add/remove items to their cart on your site before checkout? If your concern is that the buyer's cart doesn't seem to retain items from one page to another on your site, please see this help page:

http://www.e-junkie.com/ej/trouble.cart-items-not-retained.htm



We do not support quantity=0, as that would mean the item is not in the buyer's cart at all, so trying to pass that parameter in a cart button URL has the same effect as if that parameter was not being passed at all, i.e. it simply adds the item to the cart. I can ask Dev if it might be possible to support quantity=0 as a "remove item from cart" action, or if we have another way to perform that action aside from simply using the Remove checkbox in the cart.



Our cart sets a cookie in each buyer's browser to keep track of which cart instance is theirs in our database; this cookie normally expires in 24 hours after the buyer's last cart view, which you can override using EJEJC_CDAYS= in function EJEJC_config(){} to specify a different number of days for cookie expiration. If you set EJEJC_CDAYS=0, the cookie would expire immediately, leaving no way to track each buyer's cart instance, so any item(s) added to their cart would be lost the instant they close/hide their cart view. I can see if it might be possible to interpret EJEJC_DAYS=0 as a "session" cookie that expires as soon as the buyer closes their browser.



We don't support any way of retrieving items in the buyer's cart, aside from using the cart interface itself. You're welcome to hack away at it yourself to see if you can devise a way, but we would be unable to advise you on that matter. You may want to inquire with some other Developers who have already hacked custom functionality into the cart:

http://www.e-junkie.com/ej/developer-directory.htm