After installed theme theme130k customer cannot redirect to shopping cart ,modify the following file make it return to what I want to do:
app\design\frontend\default\theme130k\template\ajax\catalog\product\view\addtocart.phtml
app\design\frontend\default\theme130k\template\ajax\catalog\product\options.phtml
app\design\frontend\default\theme130k\template\ajax\catalog\product\view.phtml
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;
// Start of our new ajax code
if (!url) {
url = jQuery('#product_addtocart_form').attr('action');
}
url = url.replace("checkout/cart","ajax/index"); // New Code
var data = jQuery('#product_addtocart_form').serialize();
data += '&isAjax=1';
jQuery('#ajax_loader').show();
try {
jQuery.ajax( {
url : url,
dataType : 'json',
type : 'post',
data : data,
success : function(data) {
jQuery('#ajax_loader').hide();
if(data.status == 'ERROR'){
jQuery('body').append('<div class="alert"></div>');
jQuery('.alert').slideDown(400);
jQuery('.alert').html(data.message).append('<button></button>');
jQuery('button').click(function () {
jQuery('.alert').slideUp(400);
});
jQuery('.alert').slideDown('400',function(){
setTimeout(function(){
jQuery('.alert').slideUp('400',function(){jQuery(this).slideUp(400)});
},7000)
});
}else{
jQuery('.alert').html(data.message).append('<button></button>');
jQuery('.alert').slideDown(400);
jQuery('.alert').html(data.message).append('<button></button>');
jQuery('button').click(function () {
jQuery('.alert').slideUp(400);
});
jQuery('.alert').slideDown('400',function(){
setTimeout(function(){
jQuery('.alert').slideUp('400',function(){jQuery(this).slideUp(400)});
},7000)
});
if(jQuery('.block-cart')){
jQuery('.block-cart').replaceWith(data.sidebar);
}
if(jQuery('.header .links')){
jQuery('.header .links').replaceWith(data.toplink);
}
if(jQuery('.block-cart-header')){
jQuery('.block-cart-header').replaceWith(data.sidebar_header);
}
}
}
});
} catch (e) {
}
// End of our new ajax code
this.form.action = oldUrl;
if (e) {
throw e;
}
}
}.bind(productAddToCartForm);
the above code change to the following code.
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);