Bug if have more variations, for example 50

This topic has 10 replies, 4 voices, and was last updated 2 years, 1 months ago ago by Rose Tyler

  • Avatar: Giovanni
    Giovanni
    Participant
    February 25, 2022 at 18:33

    if i use variations size and colors and have few variations, is work fine, but if have more variations for example 50 is not work, not view a X on the size or on the colors that have out of stock on e-commerce.

    Please, contact administrator
    for this information.
    9 Answers
    Avatar: Niddy
    Niddy
    Participant
    February 25, 2022 at 20:45

    Hi @giovanni-2

    Not admin but I needed to do this. It’s easy using functions in child theme (Left Menu -> Appearance -> Theme Editor
    Open functions.php – child theme.)

    Add the following code at the end before last ?>

    function custom_woo_variations_limit( $limit ) {
    	$limit = 200;
    	return $limit;
    }
    add_filter( 'woocommerce_rest_batch_items_limit',  'custom_woo_variations_limit' );

    Change limit to whatever suits. Hope this helps 🙂

    Avatar: Giovanni
    Giovanni
    Participant
    February 26, 2022 at 05:46

    i insert the code but i have the same problem, the problem is only if have more variations over 50 on a product, i have tested it on three sites with same template and have same problem.

    TypeError: Cannot read properties of undefined (reading ‘image’)
    at https://www.mysite.com/wp-content/plugins/et-core-plugin/packages/st-woo-swatches/public/js/frontend.min.js:1:2229

    Please contact administrator
    for this information.
    Avatar: Niddy
    Niddy
    Participant
    February 26, 2022 at 14:07

    @giovanni-2

    My apologies I’m using the out-the-box swatches and it’s fine. If you’ve used a swatch plug-in then the code above won’t work. So just delete it from functions if you’ve added it.

    I’m doing hundreds of edits to a theme so use functions where possible as plugins are a pain when there’s updates so we avoid them at all costs.

    Good luck. 🍻

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    February 28, 2022 at 11:25

    Hello, @giovanni-2

    Provide us with link to your product and also WP Dashboard and FTP access to your site. We’ll check the issue in more detail.

    Regards

    Avatar: Giovanni
    Giovanni
    Participant
    March 4, 2022 at 15:34

    i installed a plugin temporary ( Variation Swatches for WooCommerce
    ) this plugin work, but i wold like to use your system and delete this plugin, i have same bug with your system on 5 sites with xstore.
    I saw that the videos I had attached previously were private, so you couldn’t see them… Sorry, now i enabled video of the bug to public view, see video on private area with error console, i are sure, that you are able to reproducing same issue on your demo site if you set 10 colors and 12 size with different quantity and setting 0 disponibility on two size.. Now you are able to click in the products not present in stock and does not see the X to the unavailable sizes.
    You see error on private area.

    Please contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 5, 2022 at 09:17

    Hello,

    Please provide temporary wp-admin and FTP access, so we can take a closer look. Also, provide URLs of mentioned products.
    Create an account via Dashboard (Users > Add new) with administrator role http://prntscr.com/s3rc9m > provide us with username and password via the Private Content area http://prntscr.com/s5mao7 You can use any email for it.
    If you do not know how to create FTP contact with your hosting provider, they will help you.

    Regards

    Avatar: Giovanni
    Giovanni
    Participant
    March 6, 2022 at 00:35

    This is a working e-commerce, unfortunately not have possibility to send you administration of this site for GDPR policy, ( or you sign me a regular documentation of GDPR, that i send you, for access to sensible data ) But you are able to reproduce this error on your test site, is very simple, you create one variable product with 10 colors and 12 sizes for each color.. make two or more size to 0 ( out of stock ) and see on your demo site the error, that you see on video that i send you on private area, If you don’t want to test it on your demo site, send me a temporary key of your template, in this mode i install your template to a demo site on my server for recreating this problem and send you administration and ftp access of demo site.

    Please contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 6, 2022 at 10:30

    Hello,

    I’ve passed this question to one of our developers. I will let you know once get an answer. Our developers team will be back at work after the weekend. Please be patient.

    Regards

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 6, 2022 at 15:51

    Hello,

    Please, add next code to your child-theme/functions.php

    add_filter( 'woocommerce_ajax_variation_threshold', function($limit) {
    	return 70;
    } );

    By default woocommerce set limit to load 30 variations but if user has more than such count – then you should simply add code to make it work and load more variations by default.

    Regards

  • Viewing 10 results - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.