This topic has 49 replies, 7 voices, and was last updated 9 years, 5 months ago ago by Stan Russell
Hello,
I’ve updated the code in woo.php file.
Please check your site now and clear browser cache before.
Thank you.
Regards,
Eva Kemp.
somehow is working, but I need to manually refresh the page, this was not so when was working, I believe something is missing. I can see products in Ajax cart when I F5 only!, This would had been updating on the way as I add products. Can you check please.
Hello,
We’ve fixed the issue.
Please check.
Regards,
Eva Kemp.
Yes the issue is fixed, can you please point out what was modified files / anything else. So that I can make a safe backup of them, while we also have others issues to rezolve. So not to overwrite the changes done. And indeed it works now! Thanks a lot!
Hello @HighPassion,
You’re welcome.
We’ve edited woo.php file. Find the section “New AJAX add to cart action”, we’ve replaced the code from the lines 1015 to 1058.
Regards,
Eva Kemp.
Good job Eva! Thanks a lot, now we move forward finally after almost 1 week or so. 🙂 Problem solved!
Can we please have a fix that we can apply ourselves without having to disclose login details?
Hello,
You need edit the file woo.php which is available in wp-admin panel > Appearance > Editor. Find the section “New AJAX add to cart action”, replace the code with the one below from the lines 1015 to 1058.
// **********************************************************************//
// ! New AJAX add to cart action
// **********************************************************************//
add_action('wp_ajax_et_woocommerce_add_to_cart', 'et_woocommerce_add_to_cart');
add_action('wp_ajax_nopriv_et_woocommerce_add_to_cart', 'et_woocommerce_add_to_cart');
if(!function_exists('et_woocommerce_add_to_cart')) {
function et_woocommerce_add_to_cart() {
ob_start();
$product_id = apply_filters( 'woocommerce_add_to_cart_product_id', absint( $_POST['product_id'] ) );
$quantity = empty( $_POST['quantity'] ) ? 1 : apply_filters( 'woocommerce_stock_amount', $_POST['quantity'] );
$passed_validation = apply_filters( 'woocommerce_add_to_cart_validation', true, $product_id, $quantity );
if ( $passed_validation && WC()->cart->add_to_cart( $product_id, $quantity ) ) {
do_action( 'woocommerce_ajax_added_to_cart', $product_id );
if ( get_option( 'woocommerce_cart_redirect_after_add' ) == 'yes' ) {
woocommerce_add_to_cart_message( $product_id );
$woocommerce->set_messages();
}
// Return fragments
et_woocommerce_get_refreshed_fragments();
} else {
header( 'Content-Type: application/json; charset=utf-8' );
// If there was an error adding to the cart, redirect to the product page to show any errors
$data = array(
'error' => true,
'product_url' => apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id )
);
$woocommerce->set_messages();
echo json_encode( $data );
}
die();
}
}
Regards,
Eva Kemp.
Hi, this does not appear to update the cart until the cart is clicked onto, which then triggers a refresh. Let me know if I can message you login details so that this can be looked into properly. Thanks.
Hello @csmwebdesign,
Please provide us with the login details to wp-admin panel in Private Content. Don’t worry it’s visible only for administrators.
Regards,
Eva Kemp.
Login details below
Problem solved here! Tested and works as designed.
Hello @csmwebdesign,
Sorry, but the login details are incorrect.
Please check them.
Thank you.
Regards,
Eva Kemp.
Revised details
Hello @csmwebdesign,
Now you can update the theme to the latest version 2.4.1 where the bug with the cart is fixed.
Thank you.
Regards,
Eva Kemp.
I can’t see a new version of the theme on Themeforest?
Hello,
Here is the link to the new theme version: http://themeforest.net/item/legenda-responsive-multipurpose-wordpress-theme/5888906
Regards,
Eva Kemp.
Apologies I had not noticed the thread title, this is happening for me using “The Leader” theme rather than Legenda. Is there a fix for this please?
Hello @csmwebdesign,
Please provide us with the credentials to wp-admin panel in Private Content.
Regards,
Eva Kemp.
Hi, it’s in reply #17345
Thanks
Tagged: cart, not responding, responsive, theme, themes, woocommerce, wordpress
The issue related to '‘Theme is not responding to cart’' has been successfully resolved, and the topic is now closed for further responses