Reply To: custom fields

Home Page Forums WooCommerce Custom Tabs custom fields Reply To: custom fields

#692

WebshopLogic

Keymaster

Hi Jason!

You can not set it in the admin panel, and there is a filter, that can be used to solve it.

Please insert a little php code into your functions.php file in the directory of your active theme:

function wct_woocommerce_tab_content ($tab_content, $tab_code) {
		
	if ($tab_code == 'YOUR_TAB_CODE') {		
		$tab_content = '[YOUR_SHORTCODE]';
		$tab_content = apply_filters('the_content', $tab_content ); //process shortcodes
	}
	
	//$tab_content = '$tab_code: ' . $tab_code . $tab_content . chr(13); //display tab_code
	return $tab_content; 
}
add_filter ('wct_woocommerce_tab_content', 'wct_woocommerce_tab_content', 10, 2);

Please substitute YOUR_TAB_CODE and YOUR_SHORTCODE expressions with your appropriate value. If you remove the remark sign (//) from the beginning of the //$tab_content…. row, then you can see the tab_codes of your actually selected tab pages. You can write this code in the if statement.

I hope you can do what you would like this way.

If you have any question, please let me know.

Best Regards,
Peter Rath
WebshopLogic