Magento 1.9: Save custom image after click on Add to cart
In addtocart.phtml change to this code:
<div class="add-to-cart-buttons">
<button id="submit-editorApply-add-to-cart" type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span><?php echo $buttonTitle ?></span></span></button>
<?php echo $this->getChildHtml('', true, true) ?>
</div>
In view.phtml remove :
productAddToCartForm.submit = function(button, url) {
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);
In js_style1 fix those function to:
initObservers: function()
{
if (this.config.editorEnabled && this.config.isUserLoggedIn == 'true') {
$('submit-editorApply-' + this.config.rand).observe('click', this.saveDesignBut.bindAsEventListener(this));
$('submit-editorApply-add-to-cart').observe('click', this.submitApply.bindAsEventListener(this));
$('submit-editorReset-' + this.config.rand).observe('click', this.submitReset.bindAsEventListener(this));
}
},
saveDesignBut: function(event)
{
Event.stop(event);
this.option.apply();
//jQuery("#aitcg-control-panel").show();
},
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();
//jQuery("#aitcg-control-panel").show();
},