Reputation: 3490
i want to use the product page shortcode to add woocommerce product to my wordpress post. What I want to show is only the title, product image and the short description but not the whole product page. Is there any way I can achieve this?
http://docs.woothemes.com/document/woocommerce-shortcodes/#section-11
Upvotes: 0
Views: 1263
Reputation: 2953
The product shortcode includes the content-product.php
- this leaves you with a couple of options. You can either:
remove_action()
like so:
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 );
A full list of all the hooks can be found in woocommerce/includes/wc-template-hooks.php
Please note that either of these actions will affect all product ages, not just the ones rendered with the shortcode. If you want to change just the pages rendered via shortcodes then your best bet is to copy and edit the template as required (as per option 1 above) but save it in your theme folder with a different name (something like content-product-short.php
). Then create your own shortcode function that fetches your new template - look at the function inside class-wc-shortcodes.php
to get the idea.
Upvotes: 0