I'm building a virtual shop - WooCommerce - and I need a unique solution, I'd be happy to get a link to code or possibly a plugin. I have products with price, and have products without price. On the product page itself, I would like to show contact form, only to products without a price. a contact form (CF7) had prepared in advance. How and where do I put the code reviewer, and how can I put the content of the field - which has the shortcode of CF7? And where I can add the field with shortcode? I am somewhat at a loss.
1
votes
1 Answers
1
votes
You can try these steps to get desired output :
STEP 1
First you need to override content-product.php
template file by copying file inside YOUR_THEME\woocommrece\content-product.php
STEP 2
Open the file YOUR_THEME\woocommrece\content-product.php
and use this code before end of li
tag
if( empty($product->price) ){
echo do_shortcode('[YOUR CF7 SHORTCODE]');
}
Please Note I'm using woocommerce 2.4.12