Home Forums WoodMart support forum Use images from product variations limits

Use images from product variations limits

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #183766

    tjcham
    Participant

    Hi, We have both your themes, and both have problems displaying the product variation images for the feature activated by “Use images from product variations”.

    There appears to be hard limits set for when the variation image will show, and the themes behave differently.

    In Basel there seems to be a max variation of 12 variations per attribute color to show the variation image… add 13 and it reverts back to the attribute name or preview color.

    In Woodmart, there appears to be a limit of a total of variations of 30 variations of all attributes combined. 31 and it reverts back to name.

    It easy to go past these limits with shoes… 13 sizes in half sizes per color is normal and several colour variations.

    Where is the code set for these limits please?

    Also:

    In Basel the variation image will show even if the swatch preview color is set in the attribute – which is great, because sometimes you need just to use the color Swatch instead of the images… But in Woodmart the product variation image will only show if there is no color set for the attribute.

    It is good to have the possibility to use both color preview or image because it saves duplicate attributes… One color attribute for the Swatch and one for the Variation image… and how do you name these or find them in the lists? (Red for Swatch, Red for Images ?) Can you not just make it like in Basel?

    Thanks

    #183773

    tjcham
    Participant

    Some more testing….
    So in Basel, maybe not 12 variations, but also looks like 30 Variations.

    Also in Basel, 30 Variations throws a PHP error.

    Warning: Invalid argument supplied for foreach() in…/wp-content/themes/basel/inc/classes/Swatches.php on line 129

    Woodmart not giving a PHP error after 30 variations.

    #183784

    tjcham
    Participant

    This might be an ajax loading setting? I see from other plugins that it is possible to adjust this setting. 30 seems like a default, more than 40 gives page load performance issues.

    #183797

    Artem Temos
    Keymaster

    Hello,

    Try to add the following PHP code snippet to the child theme functions.php

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

    This will increase standard WooCommerce variations number to be loaded with AJAX from 150.

    Kind Regards

    #183820

    tjcham
    Participant

    Great thank you.

    Yes. Works well… Sorry that we thought this was a theme issue and not a Woocommerce issue. Thanks for the fix.

    However, when moving over to WoodMart we now have to duplicate our color attributes as they all had the swatch preview set, but for some products and use the color swatch is preferable. Was there a reason for coding Woodmart to not show attribute image if swatch color is set?

    #183834

    Artem Temos
    Keymaster

    Sorry, what do you mean by that? Could you please send us some screenshots and link with example?

Viewing 6 posts - 1 through 6 (of 6 total)