WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Add to Cart Missing for Product Variations (40 posts)

  1. mikelastphoto
    Member
    Posted 1 year ago #

    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/

  2. Roy
    Member
    Posted 1 year ago #

    You have JS issues on that page...Fix that first. You can see the error in firebug or chrome tools..

  3. mikelastphoto
    Member
    Posted 1 year ago #

    I was being lazy... fixing that JS issue solved my problem.

    I've got one bug left to fix, hoping I could get some help on it.

    On my product pages, the switching tabs with Product Description don't do anything. All three have a style="display:none"; hiding all of the text inside them. Doesn't seem right to me. Might be a conflict with my theme, but not sure what's happening here.

  4. mikelastphoto
    Member
    Posted 1 year ago #

    Edit: Not so much lazy, as just thought they were unrelated.

    Edit: Product page where the issue is:

  5. mikelastphoto
    Member
    Posted 1 year ago #

  6. Roy
    Member
    Posted 1 year ago #

    That usually means JS is not firing for those tabs. Have you tried with default theme to ruled out if it is or not your theme issue?

  7. mikelastphoto
    Member
    Posted 1 year ago #

    2 for 2. Thanks!

    Had forgot to update a conflicting class name on the JS side of woocommerce and had done the CSS side.

  8. mikelastphoto
    Member
    Posted 1 year ago #

    Torn between starting a new thread and keeping this one going... as I'm pretty far off the original request now....

    Has anyone had an issue with Breadcrumbs not showing in the store? I've poured over the settings on the backend and dont see anything to turn them on/off in there that might have been changed by accident. Still looks to be in the hooks, but never ends up in the front end.

  9. johntodd
    Member
    Posted 12 months ago #

    Mikelastphoto- I just want to say thanks. The problem with the variable product add-to-cart button has had me pulling out my hair for 3 days now. I took a look at your file and got it fixed on a site that goes live in 48 hours.

    Thanks a million!

  10. mikelastphoto
    Member
    Posted 12 months ago #

    No problem John. I paid $5 to get it figured out and had the guys at Woo pull it in for the future.

    https://bountify.co/wp-theme-woocommerce-js-issue-cannot-read-property-of-undefined - has the specific problem line.

    Unfortunately, that line HAS to be the top line of the three for my theme, so if I automatically upgrade WooCommerce, I need to go back and make that in the JS file. Just a heads up.

  11. Trans4
    Member
    Posted 9 months ago #

    Hi All,

    My first post so please be nice :)

    I have a similiar problem but using a DXTheme and WooCommerce with a dev-site I'm building.

    With variations created no "add to cart" is available.

    Site is: http://trans4.co.uk/DevTest1-WP/?product=12-corner-carousel-set

    Been scratching my head for a few days now, any indication on what the issue is would be grately appreciated.

    Regards,

    Roger

  12. mikelastphoto
    Member
    Posted 9 months ago #

    https://bountify.co/wp-theme-woocommerce-js-issue-cannot-read-property-of-undefined has the answer.

    Take the JS from the file add-to-cart-variation.js and find the line with:
    all_variations = window["product_variations_" + product_id];
    and move it to the top of the 3 similar items in that section.

    Then take everything from add-to-cart-variation.js and paste it into add-to-cart-variation.min.js.

    The only problem is, auto-updates from WooCommerce break it again, and you need to go back and change the order of the variations and overwrite the .min file.

    A temporary solution until a more permanent solution arises.

  13. Roy
    Member
    Posted 9 months ago #

    A work around should not be needed as it works fine out of the box. Trans4: are you sure you're running the latest version of your theme?

  14. Trans4
    Member
    Posted 9 months ago #

    My bad, I thought I had replied with a yes :) .

  15. e.bornhop@gmail.com
    Member
    Posted 9 months ago #

    hey friends

    i am experiencing the same issue as some of you were: the add to cart button is missing when i have variations to my products but works fine if there are no variations. i am slightly new to wordpress so there was one major issue that is preventing me from fixing this problem:

    thanks to mikelastphoto, i think i understand what i must do but thanks to my lack of experience i am unsure as to where i might find "line 128" i guess it is
    all_variations = window["product_variations_" + product_id];
    to make the appropriate edits

    i tried searching in the edit section of my woocommerce plugin but i gave up after several unsuccessful attempts.

    could someone please give me a detailed description of a means to finding this? then i will also able to launch my site.

  16. Roy
    Member
    Posted 9 months ago #

    Trans4: if you go to the demo page of your theme, you can see it works fine. Hence I asked if you were sure you're using the latest build of your theme. Have you tried contacting them?

  17. Trans4
    Member
    Posted 9 months ago #

    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.

  18. Roy
    Member
    Posted 9 months ago #

    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.

  19. Trans4
    Member
    Posted 9 months ago #

    Hi SplashingPixels,

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

  20. Trans4
    Member
    Posted 9 months ago #

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

  21. Cie Martire
    Member
    Posted 9 months ago #

    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?

  22. eqhes
    Member
    Posted 8 months ago #

    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 ;).

  23. gab1982
    Member
    Posted 6 months ago #

    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

  24. varktech.com
    Member
    Posted 6 months ago #

    @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...

  25. joulyanna
    Member
    Posted 5 months ago #

    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.

    http://www.dollyskin.ro/shop/?product=missha-m-perfect-cover-50ml

  26. alexb823
    Member
    Posted 5 months ago #

    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

  27. Tibet I Tech
    Member
    Posted 5 months ago #

    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

  28. h1l3
    Member
    Posted 5 months ago #

    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

  29. h1l3
    Member
    Posted 5 months ago #

    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.

  30. ouverz
    Member
    Posted 5 months ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic