0
votes

I can’t add things in cart from the product view (template/catalog/product/view.php)? It says 0 in the QTY and if you change to a higher number you still can’t add that to the cart…

DEMO: http://eldeskin.com/magento/index.php/ansiktskrem.html

After reading ALOT on other forums, the error may be caused of JavaScript error. I used the Safari error console and see there is an error in js/prototype/prototype.js

TypeError: ’undefined’ is not a function (evaluating: ’element.dispatchEvent("on" + actualEventName, responder)’) TypeError: ’undefined’ is not a function (evaluating: ’element.dispatchEvent(event)’)

1

1 Answers

2
votes

My money is on this: You have this in the source of your page:

<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script type="text/javascript">
// Using jQuery.

$(function() {
    $('#form-search').each(function() {
        $(this).find('input').keypress(function(e) {
            // Enter pressed?
            if(e.which == 10 || e.which == 13) {
                this.form.submit();
            }
        });

        $(this).find('input[type=submit]').hide();
    });
});
</script>

jQuery conflicts with prototype. You need to add jQuery.noConflict() after you include the js file, and for any function that uses jQuery, do not use $. IT should be like this:

jQuery(function() {
    jQuery('#form-search').each(function() {
        jQuery(this).find('input').keypress(function(e) {
            // Enter pressed?
            if(e.which == 10 || e.which == 13) {
                this.form.submit();
            }
        });
        jQuery(this).find('input[type=submit]').hide();
    });
});

EDIT:
As for the qty, the problem is not javascript. In the qty box, by default, is shown the value of the minimum sale qty set on the product in the inventory tab in the backend. Set that to 1 and it should solve your issue.