• Resolved opicron

    (@opicron)


    I have a custom hook to show the stock status. It seems that with 2.0 the default woocommerce hooks are no longer used. All products show as “in stock” while in fact they are not.

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter opicron

    (@opicron)

    Can we get custom hooks/filters for the wishlist page stock status. Or bring back the old functionality please.

    Thread Starter opicron

    (@opicron)

    For now I disabled showing stock status.

    Plugin Author Niloy

    (@im_niloy)

    I just checked the old version, but I can’t see any hooks used to display the stock status. Are you overriding the template via a child theme and using custom hooks?

    Thread Starter opicron

    (@opicron)

    There are no hooks, but the way you take the information from Woocommerce is changed. Look at the difference.

    OLD:

    View post on imgur.com

    NEW:

    View post on imgur.com

    Thread Starter opicron

    (@opicron)

    Either 1) add hooks to customize the display of the stock, or 2) use the Woocommerce filters/hooks to display/retrieve the stock.

    Plugin Author Niloy

    (@im_niloy)

    Hi @opicron
    Thanks for the screenshot. In the old version, are you using any other plugin to display the stock? It doesn’t look like the default WooCommerce function. You can override the template and use a custom function in the stock status loop.

    Thread Starter opicron

    (@opicron)

    @im_niloy no I am not using a plugin to show the stock. The stock is shown with the Woocommerce filters.

    It seems you do not understand the Woocommerce stock methods. The products I show in the NEW version of your plugin are NOT on stock in the backend of Woocommerce. There are no customizations!

    How can this product be shown as “In Stock”?!

    View post on imgur.com

    • This reply was modified 6 months ago by opicron.
    Plugin Author Niloy

    (@im_niloy)

    Thanks for sending the screenshot. You’re correct, both the new and old version of the code skip this feature. I’m not sure how it’s working in the old version if the function is not being called.

    Please override the wishlist-loop-item.php template by follow this article https://www.codeixer.com/docs/overwrite-wishlist-template/ to view the real stock message from WooCommerce at https://pastebin.com/bB2ztT8d.

    In the next release we will add compatible code

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Woocommerce stock hook no longer used’ is closed to new replies.