Keep shop Terms & Conditions synchronized on product pages

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 1 reply thread
  • Author
    Posts
    • #118760
      alexdezi
      Participant

      Hello!

      Is it possible to keep the terms & conditions of vendors synchronized with the ones on the product pages?
      Right now it looks like I need to make changes on all products if I make a change on the shop terms.

      Thank you!

    • #118798

      Hello,

      It is not feasible to sync store terms and condition to all products,
      What you can do is use this code to display store’s term&conditions in each product.

      add_filter('wcfm_policies_tab_element','custom_wcfm_policies_tab_element');
      function custom_wcfm_policies_tab_element ($fields) {
      	$fields['callback']	= 'fn_product_vendor_policy';
      	return $fields;
      }
      function fn_product_vendor_policy() {
      	global $WCFM, $product;
      	$vendor_id  = wcfm_get_vendor_id_by_post( $product->get_id() );
      	$store_user      = wcfmmp_get_store( $vendor_id );
      	$wcfm_policy_vendor_options = $store_user->get_store_policies();
      
      	$wcfm_policy_options = wcfm_get_option( 'wcfm_policy_options', array() );
      
      	$shipping_policy = isset( $wcfm_policy_vendor_options['shipping_policy'] ) ? $wcfm_policy_vendor_options['shipping_policy'] : '';
      	$_wcfm_shipping_policy = isset( $wcfm_policy_options['shipping_policy'] ) ? $wcfm_policy_options['shipping_policy'] : '';
      	if( wcfm_empty($shipping_policy) ) $shipping_policy = $_wcfm_shipping_policy;
      			
      	$refund_policy = isset( $wcfm_policy_vendor_options['refund_policy'] ) ? $wcfm_policy_vendor_options['refund_policy'] : '';
      	$_wcfm_refund_policy = isset( $wcfm_policy_options['refund_policy'] ) ? $wcfm_policy_options['refund_policy'] : '';
      	if( wcfm_empty($refund_policy) ) $refund_policy = $_wcfm_refund_policy;
      			
      	$cancellation_policy = isset( $wcfm_policy_vendor_options['cancellation_policy'] ) ? $wcfm_policy_vendor_options['cancellation_policy'] : '';
      	$_wcfm_cancellation_policy = isset( $wcfm_policy_options['cancellation_policy'] ) ? $wcfm_policy_options['cancellation_policy'] : '';
      	if( wcfm_empty($cancellation_policy) ) $cancellation_policy = $_wcfm_cancellation_policy;
      	?>
      	<div class="wcfm-product-policies">
      		  <?php do_action( 'wcfm_policy_content_before', $product->get_id() ); ?>
      		  
      			<?php if( !wcfm_empty($shipping_policy) ) { ?>
      			  <div class="wcfm-shipping-policies">
      					<h2 class="wcfm_policies_heading"><?php echo apply_filters('wcfm_shipping_policies_heading', __('Shipping Policy', 'wc-frontend-manager')); ?></h2>
      					<div class="wcfm_policies_description" ><?php echo $shipping_policy; ?></div>
      			  </div>
      			<?php } if( !wcfm_empty( $refund_policy ) ) { ?>
      			  <div class="wcfm-refund-policies">
      					<h2 class="wcfm_policies_heading"><?php echo apply_filters('wcfm_refund_policies_heading', __('Refund Policy', 'wc-frontend-manager')); ?></h2>
      					<div class="wcfm_policies_description" ><?php echo $refund_policy; ?></div>
      			  </div>
      			<?php } if( !wcfm_empty( $cancellation_policy ) ) { ?>
      			  <div class="wcfm-cancellation-policies">
      					<h2 class="wcfm_policies_heading"><?php echo apply_filters('wcfm_cancellation_policies_heading', __('Cancellation / Return / Exchange Policy', 'wc-frontend-manager')); ?></h2>
      					<div class="wcfm_policies_description" ><?php echo $cancellation_policy; ?></div>
      			  </div>
      			<?php } ?>
      			
      			<?php do_action( 'wcfm_policy_content_after', $product->get_id() ); ?>
      		</div>
      	<?php
      }

      Thanks.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.