Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #675514

    Hi Guys.

    We have a woocommerce install and

    I need to hide from front end view, out of stock Variations.

    As you can see in this example we will have many variations that will never have stock (such as 8XL,9Xl etc)

    We have the site connected to the stock control system so we always have extra supperfluous variations coming across that we cant control.

    I think if we can prevent Ajax from taking over variation display or increase the threshold this will fix the problem. But we cant seem to get the code to work and dont know where to put it.

    “(something like this from https://woocommerce.wordpress.com/2015/07/13/improving-the-variations-interface-in-2-4/

    function custom_wc_ajax_variation_threshold( $qty, $product ) {
    return 10;
    }
    add_filter( ‘woocommerce_ajax_variation_threshold’, ‘custom_wc_ajax_variation_threshold’, 10, 2 ); ))) ”

    https://wordpress.org/support/topic/woocommerce-243-hide-nonexistent-variations

    At the moment Products with less than 20 variations have the Zero stock level variations hidden. But when there is more variations the Zero stock level variations are visible on the front end.

    Thanks for your Help

    • This topic was modified 8 years, 3 months ago by offthehook33.
    #676458

    Hey offthehook33,

    Please try adding following code to Functions.php file in Appearance > Editor

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

    If that does not work, please create a temporary admin login and post it here privately.

    Best regards,
    Yigit

    #842804

    Hello, is this suggestion still valid? My site is still showing product variations that are Out of Stock….thank you!

    #843020

    Hi Jay Hook,

    Have you tried it? Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #843266
    This reply has been marked as private.
    #844655

    Hi,

    Thank you for the update. I tried to login to the site but the credentials are not working. Please check.

    Best regards,
    Ismael

    #848843
    This reply has been marked as private.
    #848946

    Hi,

    Thank you for the info. Did you set the “Stock status” of each variation and enable the “Out of stock visibility” in the Woocommerce > Settings > Products > Inventory panel?

    Where can we see the issue again? Please provide a link to the page.

    Best regards,
    Ismael

    #854467

    Hi,

    I apologize for not responding, as we were dealing with Hurricane Irma. I’ve posted an example page in the private data area.

    If you look at product “07 Dusk”, it is showing in the grid, but that item has a stock of “0”. I did notice, however, that Variation is tagged as “In Stock”.

    However, if I go into my Lightspeed Retail account, that product has a stock of “0”, so shouldn’t the variation’s stock status be set to “Out of Stock” whenever an import or sync occurs???

    Thanks for the help.

    -Jay

    #854785

    Hi,

    I’m sorry to hear about your troubles. I hope your family are fine.

    I would like to check the settings again but the login credentials are not working anymore. Please check it.

    Best regards,
    Ismael

    #857016

    Hi Ismael,

    I just logged in and verified the following credentials. I have posted them in the Private Content section. Thank you!

    -Jay

    #857303

    Hi,

    You have to set the “Stock Status” manually. The stock quantity will not automatically update the value of the stock status option.

    Best regards,
    Ismael

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