Theme is not responding to cart - by HighPassion

This topic has 49 replies, 7 voices, and was last updated 9 years, 5 months ago ago by Stan Russell

  • Avatar: Eva
    Eva Kemp
    Support staff
    September 26, 2014 at 11:32

    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.

    Avatar: HighPassion
    HighPassion
    Participant
    September 26, 2014 at 11:38

    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.

    Avatar: Eva
    Eva Kemp
    Support staff
    September 26, 2014 at 13:38

    Hello,

    We’ve fixed the issue.

    Please check.

    Regards,
    Eva Kemp.

    Avatar: HighPassion
    HighPassion
    Participant
    September 26, 2014 at 14:33

    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!

    Avatar: Eva
    Eva Kemp
    Support staff
    September 26, 2014 at 18:24

    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.

    Avatar: HighPassion
    HighPassion
    Participant
    September 26, 2014 at 18:37

    Good job Eva! Thanks a lot, now we move forward finally after almost 1 week or so. 🙂 Problem solved!

    Avatar: csmwebdesign
    csmwebdesign
    Participant
    September 26, 2014 at 18:41

    Can we please have a fix that we can apply ourselves without having to disclose login details?

    Avatar: Eva
    Eva Kemp
    Support staff
    September 26, 2014 at 19:23

    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.

    Avatar: csmwebdesign
    csmwebdesign
    Participant
    September 26, 2014 at 22:51

    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.

    Avatar: Eva
    Eva Kemp
    Support staff
    September 27, 2014 at 00:48

    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.

    Avatar: csmwebdesign
    csmwebdesign
    Participant
    September 27, 2014 at 16:05

    Login details below

    Please, contact administrator
    for this information.
    Avatar: HighPassion
    HighPassion
    Participant
    September 27, 2014 at 16:27

    Problem solved here! Tested and works as designed.

    Avatar: Eva
    Eva Kemp
    Support staff
    September 27, 2014 at 16:58

    Hello @csmwebdesign,

    Sorry, but the login details are incorrect.
    Please check them.

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: csmwebdesign
    csmwebdesign
    Participant
    September 27, 2014 at 17:25

    Revised details

    Please, contact administrator
    for this information.
    Avatar: Eva
    Eva Kemp
    Support staff
    September 29, 2014 at 13:22

    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.

    Avatar: csmwebdesign
    csmwebdesign
    Participant
    October 1, 2014 at 21:17

    I can’t see a new version of the theme on Themeforest?

    Avatar: Eva
    Eva Kemp
    Support staff
    October 1, 2014 at 23:25

    Hello,

    Here is the link to the new theme version: http://themeforest.net/item/legenda-responsive-multipurpose-wordpress-theme/5888906

    Regards,
    Eva Kemp.

    Avatar: csmwebdesign
    csmwebdesign
    Participant
    October 2, 2014 at 03:42

    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?

    Avatar: Eva
    Eva Kemp
    Support staff
    October 2, 2014 at 13:52

    Hello @csmwebdesign,

    Please provide us with the credentials to wp-admin panel in Private Content.

    Regards,
    Eva Kemp.

    Avatar: csmwebdesign
    csmwebdesign
    Participant
    October 3, 2014 at 16:16

    Hi, it’s in reply #17345

    Thanks

  • 1 2 3
    Viewing 40 results - 21 through 40 (of 49 total)

The issue related to '‘Theme is not responding to cart’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.