0

when we upload image in product view page and click on "Add to cart", its Adding product to cart successfully, but when we click on "add to cart" directly without uploading an image , it displaying pop up box & displaying message "Add text or image".

I want to Hide the pop up box when we click on "Add to cart" directly.

I need similar to this link : link2

addtocart.phtml

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

script :

<script>

initObservers: function() 
{ 
if (this.config.editorEnabled && this.config.isUserLoggedIn == 'true') { 
$('submit-editorApply-add-to-cart').observe('click', this.submitApply.bindAsEventListener(this)); 
} 
}, 

submitApply: function(event) 
{ 
Event.stop(event); 
this.option.apply(); 
if(window.productAddToCartForm == 'undefined') { 
var productAddToCartForm = new VarienForm('product_addtocart_form'); 
} else { 
var productAddToCartForm = window.productAddToCartForm; 
} 
productAddToCartForm.submit(); 

},
</script>

enter image description here

11
  • Cant click on add to cart even after adding image. It still shows "upload image or text." Apr 7, 2017 at 13:42
  • @KingshukDeb can you please recheck link , its working for me...... Apr 7, 2017 at 13:43
  • @KingshukDeb sorry, we need to login to check that, can you please login with demo credentials : kidsdial11@gmail.com , pw : kidsdial11 Apr 7, 2017 at 13:50
  • What do you mean? login where? Apr 7, 2017 at 13:51
  • @KingshukDeb please login here : login link or once you click on save design in link , it will show options to login.... Apr 7, 2017 at 13:54

1 Answer 1

1

They have just added a frontend validation for this. The class name is input-text aitcg-required product-custom-option . If you remove this aitcg-required part from class name you will be able to add products to cart.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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