1 / 3
Nov 2014

I'm testing the EJEJC_multiAdd() function. The click handler for my checkout button gets the product id's and quantities and opens the E-Junkie cart using the multiAdd() function.



If you edit the quantities in the cart and/or proceed straight to payment, it works great. But, if you close the E-Junkie cart, change the product quantities, and click the checkout button again, the EJEJC_multiAdd() does not update the quantities for items already in the cart.



Is there a way to programmatically (via javascript) update quantities in the cart? If not, is there a way to clear the cart via javascript?

  • created

    Nov '14
  • last reply

    Nov '14
  • 2

    replies

  • 1.3k

    views

  • 2

    users

If I understand you correctly, the issue is that passing the &quantity= parameter in an Add to Cart URL does not override any existing quantity of that item that may already be in the buyer's cart. I've confirmed that's how it works even with regular Add to Cart buttons regardless of the EJEJC_multiAdd() function. We could consider supporting such an override behavior, but that opens the question of whether that might run afoul of some other sellers' existing setups where they're counting on the current behavior.



That said, it should be easy to just reset the buyer's cart with JS, presuming you're using the overlay-style cart that displays "inside" your page, which is required to invoke the EJEJC_multiAdd() function anyway. Since the overlay cart renders as part of your page, each buyer's cart instance is tracked in their browser by setting a cookie for your page's domain; thus, other scripting in your page could read, alter or delete that cookie. The main cart cookie is named 'ej_ejc_cart_idXXXXXX', where XXXXXX would be your E-junkie client ID, which you can find in your Seller Admin > Account Summary or the &cl= value in your button URLs.