Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1320595
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 8 years ago.
Improve this questionIn a woocommerce theme, Im trying to show a warning when product is out of stock. Something like this:
<?php if ('this_product_is_out_of_stock'): ?>
<p>This product is out of stock. It can be purchased by custom made order.</p>
<?php endif; ?>
Is there a function to say 'this_product_is_out_of_stock' or some other way to achieve it?
I was searching woocommerce api docs unsuccesfully: /
Thank you in advance.
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 8 years ago.
Improve this questionIn a woocommerce theme, Im trying to show a warning when product is out of stock. Something like this:
<?php if ('this_product_is_out_of_stock'): ?>
<p>This product is out of stock. It can be purchased by custom made order.</p>
<?php endif; ?>
Is there a function to say 'this_product_is_out_of_stock' or some other way to achieve it?
I was searching woocommerce api docs unsuccesfully: https://docs.woocommerce/wc-apidocs/
Thank you in advance.
Share Improve this question asked Sep 4, 2016 at 6:54 aitoraitor 7252 gold badges8 silver badges23 bronze badges 1- 1 Questions about the inner workings of third party plugins are better asked at their author's forum, in this case: wordpress/support/plugin/woocommerce – cjbj Commented Sep 4, 2016 at 14:27
1 Answer
Reset to default 18Try something like this
global $product;
if ( ! $product->managing_stock() && ! $product->is_in_stock() )
echo '<p>This product is out of stock. It can be purchased by custom made order.</p>';
本文标签: functionsHow to get woocommerce inventory status
版权声明:本文标题:functions - How to get woocommerce inventory status 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742085436a2419946.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论