admin管理员组文章数量:1430281
How to display main product description on the cart page? I tried this but it works only for variation description.
$_product->description
I want to display the main description which is the same for all variations.
How to display main product description on the cart page? I tried this but it works only for variation description.
$_product->description
I want to display the main description which is the same for all variations.
Share Improve this question edited May 6, 2019 at 10:37 norman.lol 3,2413 gold badges30 silver badges35 bronze badges asked May 6, 2019 at 10:12 Marcin UrbańczykMarcin Urbańczyk 134 bronze badges1 Answer
Reset to default 1$_product object is product variation object.
You have to first get the parent product id and then get the description of parent product.
$parent_product_id =$_product->get_parent_id();
$parent_product = get_post($parent_product_id);
echo $content = $parent_product->post_content;
Or
echo $_product->parent->description;
本文标签: woocommerce offtopicDisplay description on cart page
版权声明:本文标题:woocommerce offtopic - Display description on cart page 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745521440a2661643.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论