Adding Multiple Lines to Additional Information Tab
-
Hi All,
First off, I have
-
zero
knowledge of PHP but have managed to wrangle the following snippet into displaying product dimensions under the Additional Information tab. Yes, it’s ugly, but it does the job.
function tjn_woocommerce_display_product_attributes($product_attributes, $product){ $product_attributes['dimensions'] = [ 'label' => __('Size (cm)', 'text-domain'), 'value' => get_post_meta($product->get_ID(), 'Widcm', true) . " x " . get_post_meta($product->get_ID(), 'Hgtcm', true) . " x " . get_post_meta($product->get_ID(), 'Depcm', true), ]; return $product_attributes; } add_filter('woocommerce_display_product_attributes', 'tjn_woocommerce_display_product_attributes', 20, 3);
I’d really like to display the net weight of products too (already have meta: Wgtgm populated in my product database), but can’t figure out how to add two lines to the tab. Any ideas?
Many thanks in advance
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Adding Multiple Lines to Additional Information Tab’ is closed to new replies.