-
AuthorPosts
-
August 9, 2016 at 2:59 pm #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)?August 9, 2016 at 5:41 pm #670429Hey 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/Let us know if you have any questions.
Best regards,
VinayAugust 9, 2016 at 10:56 pm #670544Hi 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.pngSo,
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.
August 10, 2016 at 7:02 pm #671040Hey 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.August 10, 2016 at 9:29 pm #671076Hi Peter, unfortunately I am still waiting…
August 11, 2016 at 8:31 am #671195I 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).
August 11, 2016 at 8:41 am #671198Dear 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,
JurgenAugust 11, 2016 at 2:29 pm #671336Hi 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
KriesiAugust 12, 2016 at 9:07 am #671765I 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.
August 12, 2016 at 1:36 pm #671818Hi,
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,
VinayAugust 12, 2016 at 10:49 pm #672116Hi 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!,
JurgenAugust 13, 2016 at 12:14 am #672128Hi 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 downHaving 31 variations => http://www.ur-upload.de/i/2016/08/13/31-variations.png
Because of this “false” statement, all attributes are shownI 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!
August 13, 2016 at 8:03 am #672228Hi,
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,
VinayAugust 14, 2016 at 10:23 pm #672411Hi 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,
JurgenAugust 15, 2016 at 4:10 pm #672766FYI, 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.
August 15, 2016 at 4:18 pm #672781Hey!
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,
BasilisAugust 16, 2016 at 8:22 am #673054You are a rockstar Jurgen! Thank you so much :) I hope you have an awesome week ahead of you.
December 15, 2016 at 2:22 am #724714Jurgen,
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,
LouiseDecember 15, 2016 at 3:20 am #724719Fixed it – changed the PHP version back from 7.0 to 5.6.28 which removed the error.
December 15, 2016 at 9:07 am #724803Hi 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,
JurgenDecember 19, 2016 at 8:24 am #725964Hi Jurgen,
I don’t either – just a shame I had to change back to PHP 5.6.28 to make this work.
Cheers,
LouiseDecember 20, 2016 at 6:59 am #726427Hi,
Glad all is well :)
Thanks for the letting us know about the steps you took to make it work.Best regards,
VinayDecember 20, 2016 at 11:52 pm #726827Apparently this may work with PHP 7.0 – not yet tested:
add_filter( 'woocommerce_ajax_variation_threshold', function() { return 50; } );
December 24, 2016 at 11:48 am #728120 -
AuthorPosts
- You must be logged in to reply to this topic.