WPIntell

Source evidence

Woocommerce stock hook no longer used

Wishlist for WooCommerce · support · 2024-05-15T10:49:00+00:00

neutralsentiment
mediumseverity
0.53relevance
8replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

3 / 31 rows with source links

9.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

28 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
opicron resolved
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] Can we get custom hooks/filters for the wishlist page stock status. Or bring back the old functionality please. For now I disabled showing stock status. 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? 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 Either 1) add hooks to customize the display of the stock, or 2) use the Woocommerce filters/hooks to display/retrieve the stock. 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. @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 2 years ago by opicron . 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

Comments

8 shown
opicron 2024-05-15T10:50:00+00:00

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

opicron 2024-05-15T10:51:00+00:00

For now I disabled showing stock status.

Niloy – Codeixer 2024-05-15T20:38:00+00:00

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?

opicron 2024-05-16T08:19:00+00:00

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

opicron 2024-05-16T08:20:00+00:00

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

Niloy – Codeixer 2024-05-17T00:32:00+00:00

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.

opicron 2024-05-17T06:28:00+00:00

@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 2 years ago by opicron .

Niloy – Codeixer 2024-05-18T03:21:00+00:00

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