Support » Plugin: WooCommerce » Add to Cart Missing for Product Variations

  • mikelastphoto

    (@mikelastphoto)


    I’ve integrated WooCommerce into my theme (Reaction 2.0 based on Super Skeleton).

    You can see it live (but no direct link at: http://www.connectedinmotion.ca/shop/ )

    For my T-Shirt product that has variations, I can’t get Add to Cart to show, no matter what combo of variations I put in.

    As a test, I went through the code and found:
    <div class="single_variation_wrap" style="display:none;">
    Removing display:none I was able to see the Add to Cart button, but when I input the product settings and click Add to Cart, I get the message that says ‘Please choose product options’.

    Some notes:
    – I do have wp_footer in my theme.
    – The variations have stock, SKU, shipping class, tax class, weight and price filled in or inherited from the parent.
    – The Clear Selection button doesn’t do anything, making me think its a JS issue.
    – The console in Chrome doesn’t seem to have any pertinent JS issues.
    – Add to Cart works fine on a single item with no variations.
    – ‘Enable AJAX add to cart buttons on product archives’ didn’t seem to have an effect.
    – ‘Enable WooCommerce CSS styles’ is unselected, but everything is in its own child template and CSS.

    Hopefully someone can help me out and take a look, it would be much appreciated.

    http://wordpress.org/extend/plugins/woocommerce/

Viewing 15 replies - 16 through 30 (of 39 total)
  • On the demo page (unless I’m not looking at the right URL) the demo products dont have variations.

    Standard (non variable products) work fine.

    I’ve contacted both WooThemes and DXThemes and received a standard reply – check documentation, contact the 3rd party, review documentation…..post question on here.

    Looks like I wont be recommending this theme or plugin.

    Roy Ho

    (@splashingpixelscom)

    Trans4: this is not a WC plugin issue. It is with your theme. Ask them to update their theme to be compatible with the latest WC plugin version.

    Hi SplashingPixels,

    Yes I agree, I’m currently going through the motions of reviewing other themes to see how they adopt the variation.

    UPDATE – I’ve now rolled back to WooCommerce 1.6.6 and seem to have the variations working with this particular theme.

    Hi Trans4, I think I have the same issue with Clothes themes from DXthemes. Please, tell me where did you find an older version of WooCommerce?
    Did you fix it?

    I was getting the same error with Woothemes Superstore Theme and solved it updating Woodojo to the 1.5.3 version (I was on 1.5.2). Hope it helps ;).

    Hi I have added multiple variations to a product e.g. Colours and Material however my add to cart button isn’t showing.

    http://www.bbdimension.com/files/wp3/product/parking/?themedemo=communitysigns

    I have tested it on the default wordpress theme but still no luck as you can see here:

    http://www.bbdimension.com/files/wp3/product/parking/?themedemo=twentyeleven

    I did some research but can’t find out whats going wrong. I looked in FireBug and resolved the jquery.cookie error but that didn’t fix it (so i switched it back).

    The add to cart button didn’t show, so I forced it to show in the CSS but even when doing that I get this error: Please choose product options…

    despite me choosing options from the dropdowns

    Any help would be greatly appreciated as this is a major problem if a person cannot buy the products from the store.

    thanks
    Graham

    @gab1982,
    using http://www.bbdimension.com/files/wp3/product/parking/?themedemo=communitysigns , in firefox the add to cart shows up correctly after the variation options are chosen…

    Hi! I have the same problem with the variations.

    A couple of days ago everything was working great but then I installed the available updates for wordpress and woocommerce and then customers started sending me messages that they can’t add products to cart.

    I have no idea what to do about this or what is causing this problem.

    Cosmetice coreene

    My variable products stopped working after an update. The ADD to CART button was not showing. The below solution working for me. It was a jquery cookie error. Had to add some functions to theme functions.php file and change the name of the files jquery.cookie.js and jquery.cookie.min.js

    The “ADD TO CART” button is not showing on my website. http://oldyakbazaar.com/shop/fair-trade-bling/red-bone-necklace/

    Alex: ” The below solution working for me. It was a jquery cookie error. Had to add some functions to theme functions.php file and change the name of the files jquery.cookie.js and jquery.cookie.min.js” Can you please give me more details so that i can fix this?

    Thanks

    Hi,

    I have the problem with ADD TO CART BUTTON which it is not displaying after I change the product data to: VARIABLE PRODUCT.

    the errors that display on my site:

    Failed to load resource: the server responded with a status of 406 (Not Acceptable)
    .../wp-content/plugins/woocommerce/assets/js/jquery-cookie/jquery.cookie.min.js?ver=1.3.1

    Uncaught TypeError: Object function (e,t){return new x.fn.init(e,t,r)} has no method 'cookie' cart-fragments.min.js?ver=2.0.18:1

    I just recently update the Woocommerce to 2.0.18 in WordPress 3.7.1

    I just try to follow the instruction in http://docs.woothemes.com/document/jquery-cookie-fails-to-load/
    and modify the javascript file name in the woocommerce plugin
    and also add the function script in function.php

    It seems my site is working for now without any script error.

    Hi,

    I’m also trying to make the ‘add-to-cart’ button visible permanently and I’ve done the following but nothing has changed in this regard:
    1. I’ve edited ‘add-to-cart-variation.js’ like so and place it in the following folder – child-theme/woocommerce/assets/js/frontend
    // Fallback to window property if not set – backwards compat
    if ( ! all_variations )
    all_variations = window[ “product_variations_” + product_id];
    if ( ! all_variations )
    all_variations = window[ “product_variations” ][ product_id ];
    if ( ! all_variations )
    all_variations = window[ “product_variations” ];
    if ( ! all_variations )
    all_variations = window[ “product_variations_” + product_id ];
    2. Copied the entire code to ‘add-to-cart-variation.min.js – same directory as above
    3.added the code below to functions.php file of my theme
    function register_woo_radio_button_scripts () {

    wp_deregister_script(‘add-to-cart-variation’);

    wp_dequeue_script(‘add-to-cart-variation’);

    wp_register_script( ‘add-to-cart-variation’, plugins_url( get_stylesheet_directory_uri().’woocommerce/assests/js/frontend/add-to-cart-variation.min.js’, __FILE__ ), array( ‘jquery’), false, true );

    wp_enqueue_script(‘add-to-cart-variation’);

    }

    add_action( ‘wp_enqueue_script’, ‘register_woo_radio_button_scripts’ );
    4. Working with WooCommerce 2.017 (latest version)

    What am I doing wrong or missing?

    Best Regards
    Ofer

    I finally got this to work for me, please find my re-edited code for the functions.php file (iv’e had an incorrect reference name -‘add-to-cart’ instead of ‘wc-add-to-cart’):
    added the code below to functions.php file of my theme

    function register_woo_radio_button_scripts () {
    wp_deregister_script('wc-add-to-cart-variation');
    wp_dequeue_script('wc- add-to-cart-variation');
    wp_register_script( 'wc-add-to-cart-variation', plugins_url( get_stylesheet_directory_uri().'woocommerce/assests/js/frontend/add-to-cart-variation.min.js', __FILE__ ), array( 'jquery'), false, true );
    wp_enqueue_script('add-to-cart-variation');
    }
    add_action( 'wp_enqueue_script', 'register_woo_radio_button_scripts' );

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    2. Next would be to add the line in css: .single_variation_wrap{display:block !important;}

Viewing 15 replies - 16 through 30 (of 39 total)
  • The topic ‘Add to Cart Missing for Product Variations’ is closed to new replies.