• Resolved dad0

    (@dad0)


    I would like to ensure that unavailable product variants are not displayed in the selection menu at all, or at least that they are disabled. How can I do this?

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 22 total)
  • Stef

    (@serafinnyc)

    Hello @dad0 by default all variants that are out of stock should be greyed out. Your theme seems to be custom and not something we support here.

    I did however find a hook that may help you, but again we don’t really support customization here.

    Thread Starter dad0

    (@dad0)

    It is not indicated where the code you suggested should be inserted.

    Stef

    (@serafinnyc)

    @dad0 they didn’t say? Wow, sorry about that. That’s not very nice of him. Any hook like this would go in the functions.php file of your Child Theme towards the bottom is the best place for it, click save, clear server and browser cache, then refresh that page.

    Do not place this into a Parent theme as it will get overwritten on update.

    Plugin Support omarfpg a11n

    (@omarfpg)

    Hi @dad0

    I would like to ensure that unavailable product variants are not displayed in the selection menu at all, or at least that they are disabled. How can I do this?

    Have you had a chance to try this setting in WooCommerce → Settings → Products → Inventory → Out of stock visibility → check “Hide out of stock items from the catalog”?

    Kindly let us know.

    Thanks!
    -OP

    Thread Starter dad0

    (@dad0)

    Hi @omarfpg

    Yes, the option you mentioned is already active, but I am not getting what I want.

    Hey, @dad0!

    If you go to Products > Click on the product to open the editor > Under product data, click on Inventory, there’s an option called Allow backorders.

    Is it set to not allow?

    If it is set to allow back orders, this would show the product even if it is out of stock.

    Looking forward to your reply.

    Have a wonderful day!

    Thread Starter dad0

    (@dad0)

    @serafinnyc

    I inserted the snippet, but I do not get the desired result.

    See the screen: https://ibb.co/P9THq6r

    Stef

    (@serafinnyc)

    Hello @dad0 You need to clear your cache on the server end and browser, just to make sure you’re seeing the changes take place. Also, @omarfpg suggestion might work as well if the theme is no overriding any default Woo behaviors.

    Thread Starter dad0

    (@dad0)

    Stef

    (@serafinnyc)

    I see you speak Italian and I am too. So, devi andare in Variazioni e fare screenshot lì, poiché questo è un prodotto variante.

    Translation: You need to go into Variations and take screenshots there, since this is a variant product

    Thread Starter dad0

    (@dad0)

    @serafinnyc

    Si, parlo italiano! ecco quanto mi hai chiesto: https://ibb.co/qp34854

    Plugin Support omarfpg a11n

    (@omarfpg)

    Hi @dad0,

    Your settings appear to be all properly set, so this is probably a theme issue or a third-party plugin issue. I’d like to understand your site properly. Please share with us the necessary information below for us to investigate the issue further:

    • System Status Report which you can find via WooCommerce > Status > Get system report > Copy for support.
    • Fatal error logs (if any) under WooCommerce > Status > Logs.

    You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.

    Once we have more information, we’ll be able to assist you further.

    Thanks!
    -OP

    Thread Starter dad0

    (@dad0)

    Plugin Support omarfpg a11n

    (@omarfpg)

    Thanks @dad0,

    I see a couple of fatal errors from Rank Math SEO; those don’t seem related to WooCommerce. The following troubleshooting step is running a conflict test to determine if something external is interfering.

    To test, you’ll first want to change the theme on your site to Storefront, then check to see if the issue is still present. If that resolves the problem, you’ll want to contact your theme’s developer and see if they have an update or fix.

    If changing the theme doesn’t help, you’ll want to deactivate all plugins except for WooCommerce and take a look. If that fixes the problem, re-enable the other plugins one by one (gradually), checking after each to see where the issue is coming from.

    Some important considerations
    — Be sure you have a good backup in place of your full site and database. You can ask your host for backup functionality, or you can consider using a service like Jetpack. If something goes wrong, you will be able to restore it.

    — Also, you can consider using a plugin like Health Check & Troubleshooting. This is a plugin developed by the WordPress community, and it is helpful to disable plugins without affecting your current site visitors.

    — It is also important to consider staging functionality in case you would not like to touch your production site (you can ask your host if they offer this service), or you can use WP Staging to spin up a new test site quickly.

    You can find more about this in this guide.

    Please let us know about your findings.

    Thanks!
    -OP

    Thread Starter dad0

    (@dad0)

    @omarfpg

    I also tried the code with the cache completely deactivated, and after deleting the temporary files, but it does not work! This is the snippet inserted in the function.php file of the child theme: https://gist.githubusercontent.com/JeroenSormani/e4dd137faab5530b7029c606dd723d3c/raw/134cb9eae8f5c08221486f18de37bf32b4fcb677/add-out-of-stock-text-variations-woocommerce.php

Viewing 15 replies - 1 through 15 (of 22 total)
  • You must be logged in to reply to this topic.