0

Im new to this whole Magento stuff and was wondering, we have had a few issues of where a customer clicks a product twice and it buy two of the same product, is there a way of bringing a pop up saying you have two items in the cart the same?

Any suggestions would be very helpful

0

2 Answers 2

0

If you take a look at base magento product view template after pressing add to cart the button is disabled button.disabled = true;

See /app/design/frontend/base/default/template/catalog/product/view.phtml

    var productAddToCartForm = new VarienForm('product_addtocart_form');
    productAddToCartForm.submit = function(button, url) {
        if (this.validator.validate()) {
            var form = this.form;
            var oldUrl = form.action;

            if (url) {
               form.action = url;
            }
            var e = null;
            try {
                this.form.submit();
            } catch (e) {
            }
            this.form.action = oldUrl;
            if (e) {
                throw e;
            }

            if (button && button != 'undefined') {
                button.disabled = true;
            }
        }
    }.bind(productAddToCartForm);
0

Have you instead thought about disabling the add to cart button after you click it so that the customer cannot actually press it twice?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.