We have 2 buttons in product view page

1)Create - create product programtically

2)Add to cart - Add product to cart & creating product programatically.

Issue is we dont need to create product once click on "Add to cart"

create button code

<button id="submit-editorApply-{{rand}}"  onclick="return setproductlogin(\'<?php echo Mage::registry("current_product")->getId()?>\', event);setrequestlogin();"  >

Add to cart

<button onclick="productAddToCartForm.submit(this)" id="submit-editorApply-add-to-cart">
    Add to cart>

related code

initObservers: function() 
        if (this.config.editorEnabled) {  
           $('submit-editorApply-' + this.config.rand).observe('click', this.saveDesignBut.bindAsEventListener(this));
           $('submit-editorApply-add-to-cart').observe('click', this.submitApply.bindAsEventListener(this));             

submitApply: function(event) 
         if(window.productAddToCartForm == 'undefined') { 
         var productAddToCartForm = new VarienForm('product_addtocart_form'); 
         } else { 
          var productAddToCartForm = window.productAddToCartForm; 



once i remove function : submitApply: function(event) [see full function above ] , than Add to cart button will not create any product. but after that, we need to click on create button to click on Add to cart, otherwise Add to cart will not work....

update 2

when i hide this code : $('submit-editorApply-add-to-cart').observe('click', this.submitApply.bindAsEventListener(this)); & removed aitcg-required , than both features will work, but one more issue will create that once we click directly on add to cart [ without click on create] button, than in cart page, we dont see custom image :

enter image description here

1 Answer 1


Please check whether two buttons have same form functionality..so it will create an issue.

You have to divide both functionality with help of separate forms

  • 1
    @ Nihar S : How To Display Tooltip When Customer On Mouse Hover Add to Cart Button
    – user51361
    Apr 25, 2017 at 6:09

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.