Viewing 24 posts - 1 through 24 (of 24 total)
  • Author
    Posts
  • #670344

    I have a product with 2 attributes: 9 colours & 4 sizes, but there are only 31 possible variations as one of the sizes is not available in all colours.

    When in the first drop down I select a colour with only 3 possible sizes, the 4th size appears too. Selecting the 4th size returns a message “Sorry, no products matched your selection. Please choose a different combination.” => has this always been like that? I thought the 4th size would not be in the drop down or is the drop down not AJAX reloaded with the option I selected in the first drop down?

    Thanks for clarifying if this is “works as designed” or a bug :)

    I am using:
    – WP 4.5.3
    – Enfold 3.6.1
    WooCommerce 2.5.5 (can this be the reason)?

    #670429

    Hey Jurgen,

    It’s not clear what exactly you are trying to do. Please check the WooCommerce documentation about setting up variable products
    https://docs.woocommerce.com/document/variable-product/

    WooCommerce: How to Setup Products with Multiple Options(Variations)

    Let us know if you have any questions.

    Best regards,
    Vinay

    #670544

    Hi Vinay,

    I set up dozens of web shops, so that’s not an issue. I have some questions on a specific front end behaviour (bug or request).
    – This product has 9 colours & 4 sizes => http://www.ur-upload.de/i/2016/08/09/01-backend-attributes.png
    – But not all combinations exist (31 from 36 possibilities), for example “pink” only has 3 sizes => http://www.ur-upload.de/i/2016/08/09/02-backend-variations-pink.png
    – When a customer chooses “Pink” as colour, there are 4 possibles sizes (while I would expect only 3 because there is no “any size” linked to the 4th size, “30×30”, either) => http://www.ur-upload.de/i/2016/08/09/03-frontend024fe.png

    So,
    either this is a bug with the AJAX refreshing of the drop downs based on chosen values for other attributes,
    either this is a feature request (as I know other themes have this behaviour).

    Thanks for your advice.

    Best regards,
    Jurgen

    • This reply was modified 8 years, 4 months ago by Jurgen.
    #671040

    Hey Jurgen, are you still having this problem or did they get back to you as of yet?
    I am currently having the exact same problem (Just with a different product), and have yet to resolve the issue.

    #671076

    Hi Peter, unfortunately I am still waiting…

    #671195

    I will update you if I get anything out of them, but so far I just get the same pasted message for the Woocommerce documentation. (As with most other threads with a similar topic).

    #671198

    Dear Vinay & other moderators,

    Please let us know, if the variation drop down should be updated based on possible variations with an already made choice in another drop down of that product. Thanks!

    Best regards,
    Jurgen

    #671336

    Hi Guys!

    quick question: since enfold does not really change anything with variations, have you tried activating the default theme and testing if it works then? If it does then this might be an issue with enfold and we can try to track it down. if it still does not work we at least know that its a woocommerce issues and can report that.

    Best regards
    Kriesi

    #671765

    I can do what I want to do with other themes, default themes etc. Just doesn’t want to work in this one for some reason. Not sure what the issue is.

    #671818

    Hi,

    We need to take a closer look at the issue please post us your login credentials (in the “private data” field), so we can take a look at your backend.

    Login credentials include:

    • The URL to the login screen.
    • A valid username (with full administration capabilities).
    • As well as a password for that username.
    • permission to deactivate plugins if necessary.

    Best regards,
    Vinay

    #672116

    Hi Vinay,

    I just discovered that there is only 1 product, having this issue. Other products (with a similar setup) & new products don’t have that issue… Any idea what this could be? Hence I can check that specific product in detail.

    Best regards & thanks in advance!,
    Jurgen

    #672128

    Hi Vinay,

    It seems to be an issue as soon as you have 31 or more variations.

    Having 30 variations => http://www.ur-upload.de/i/2016/08/13/30-variations.png
    Because of this code the correct combinations are shown in the other drop down

    Having 31 variations => http://www.ur-upload.de/i/2016/08/13/31-variations.png
    Because of this “false” statement, all attributes are shown

    I do found this explanation for Woo 2.4+ => https://woocommerce.wordpress.com/2015/07/13/improving-the-variations-interface-in-2-4/
    It mentions that as from 20 variations, these are loaded via AJAX instead of inline. However, it seems to be 30+ (and there is no AJAX action, no error either). I can try to add the code in functions.php (and mention “50” for example), but if one day I have a product with 51 variations I need to update the code again…

    Please find in the private part the credentials of a development copy to investigate.

    Thanks!

    #672228

    Hi,

    Thank you, Just wanted to clarify if the variations work fine on the default wordpress theme on the products that has the issue? Enfold theme do not make any modifications to the way WooCommerce core files function but we would like to further investigate this and would like to get your permission to switch the themes for testing purpose?

    At the moment adding the code to the functions as described in the WooCOmmerce dev blog is a viable solution. We do not recommend making changes to the plugin files directly as it will be lost when the plugin is updated. In case in future you think there will be 50 variations I’m afraid the code has to be edited again.

    Let us know if you have any questions.

    Best regards,
    Vinay

    #672411

    Hi Vinay,

    It seems to be the case for theme TwentyFifteen too, so this is not an Enfold issue but a WooCommerce issue. Hence I will create a ticket for WooCommerce with all available information I have. Sorry!

    I never modify plugin code, I would rather implement the code for the functions.php if that’s the solution (but then one day I would have to modify it again)…

    Best regards,
    Jurgen

    #672766

    FYI, this is the official WooCommerce response:

    The woocommerce_ajax_variation_threshold was changed to 30 in version 2.4.7 so that would explain why you are experiencing the behaviour only after 30 variations.

    When this threshold has been reached the behaviour changes slightly. Instead of adding all the variations on the page it only checks the variations when all the options are chosen. It does this by doing an ajax request to check if there is a variation available with the selected options.
    Because it is done only after all the options are selected it does not pre-filter the options and show only the available options. Instead it shows a message like the following:
    Sorry, no products matched your selection. Please choose a different combination.

    So this means that the behaviour you are experiencing is standard WooCommerce behaviour.
    If you need it to still filter the options even when there is a large amount of variations available then you will need to adjust the filter and set it to a higher value. You can use something like the following snippet to increase this number:

    function woo_custom_ajax_variation_threshold( $qty, $product ) {
        return 50;
    }       
    add_filter( 'woocommerce_ajax_variation_threshold', 'woo_custom_ajax_variation_threshold', 10, 2 );

    You would need to check that such a large amount of variations doesn’t cause any additional slowdowns or troubles on the page.

    #672781

    Hey!

    Thanks a lot for updating the topic and providing the solution.
    Please feel free to open a new ticket, if something else is needed.

    Thanks a lot

    Best regards,
    Basilis

    #673054

    You are a rockstar Jurgen! Thank you so much :) I hope you have an awesome week ahead of you.

    #724714

    Jurgen,

    I had the same problem and applied the fix that WooCommerce supplied. However, I’m getting an error although attributes and variations combinations are saved and work OK on the frontend, I’d rather not have the error. Did you get this as well? and if so, where you able to fix it?

    The error is:

    Warning: array_merge(): Argument #2 is not an array in /…/public_html/wp-includes/load.php on line 63

    Thanks,
    Louise

    #724719

    Fixed it – changed the PHP version back from 7.0 to 5.6.28 which removed the error.

    #724803

    Hi Louise,

    I don’t really see the link between the Woo fix & your issue on an argument / PHP version but if every things works, then all is fine :D

    Best regards,
    Jurgen

    #725964

    Hi Jurgen,

    I don’t either – just a shame I had to change back to PHP 5.6.28 to make this work.

    Cheers,
    Louise

    #726427

    Hi,

    Glad all is well :)
    Thanks for the letting us know about the steps you took to make it work.

    Best regards,
    Vinay

    #726827

    Apparently this may work with PHP 7.0 – not yet tested:

    
    add_filter( 'woocommerce_ajax_variation_threshold', function() { return 50; } );
    #728120

    Hi,


    @wizard247
    Thanks for sharing! :)

    Best regards,
    Yigit

Viewing 24 posts - 1 through 24 (of 24 total)
  • You must be logged in to reply to this topic.