1 / 5
Sep 2009

I wish to disable a buy button when an item is added to the cart and re-enable the button if the item is removed from the cart. How can I interogate the carts contents to do this?

  • created

    Sep '09
  • last reply

    Sep '09
  • 4

    replies

  • 846

    views

  • 3

    users

thanks for the reply, however thats not quite what I asked. My site is developed in ASP and all of the buttons are generated and controlled programatically. I can disable and reenable the buttons myself.



I'm trying to determine if I can read the contents of the Cart after its been closed down so that I can decided, or not, to change the state of my buttons.

Do you store the carts contents in cookie (or in some similar state file) on the users PC?

We store a reference point to the cart on our back end as a cookie on the users PC, not the cart data itself.



What you can do is remove the option from the products to Let Buyer Edit Quantity in Cart and then buyers will not be able to add more then one of any specific product to their cart.

frouboyI wish to disable a buy button when an item is added to the cart and re-enable the button if the item is removed from the cart. How can I interogate the carts contents to do this?





In your view cart button code, please add this -





function EJEJC_config() { EJEJC_POSTCALL=true; }

function EJEJC_shown() {



if (EJEJC_added('YOUR_ITEM_NUMBER')===true){

// write JS code to disable your button

}



}