Display Contact form 7 shortcode value in WooCommerce

Question

Sorry for the bad English
My need help:
I have created a Textarea field in the settings sections in WooCommerce > Settings > Products.

 $enquiry_form_settings[] = array ( 
  'id'   => 'we_enquiry_form_textarea',
  'name' => __( 'Add Contact Form 7 Shortcodes', 'we-extra' ),
  'type' => 'textarea',
 'css'  => 'min-height:200px',
 'placeholder' => 'Add Contact Form 7 Enquiry Form Shortcodes',
  'label' => __('Textarea', 'we-extra'),
  'sanitize' => 'sanitize_textarea_field');

The Textarea field working perfectly. But, I would like to display Contact form 7 shortcode value under the Add to Cart. When someone adds the shortcode from the admin panel (Contact_form_7_shortcode ) then, this value will be display under the Add to Cart.

Here my display code:

 function display_cform_shortcode () {
   if ( get_option ('we_enquiry_form_textarea') && get_option ( 'we_enquiry_form_textarea')){
    echo get_option ('we_enquiry_form_textarea');
   }
 }    
add_action( 'woocommerce_after_add_to_cart_button', 'display_cform_shortcode' );

Please, someone help me, how can I display.
Thanks in advacen

0
Tanmoy Biswas 8 months 2020-12-08T13:10:22-05:00 0 Answers 10 views 0

Leave an answer

Browse
Browse