Last active
April 28, 2025 08:49
-
-
Save webtoffee-git/1a73c24fe04bfb9ac70da9e608ea1b6a to your computer and use it in GitHub Desktop.
Code to Add Product Weight Below Product Name in Email Template - By WebToffee(WebToffee eCommerce Marketing Automation – Email marketing, Popups, Email customizer)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //Do not copy this line of code | |
add_action('woocommerce_order_item_meta_end', function($item_id, $item, $order, $plain_text) { | |
$product = $item->get_product(); | |
if (!$product) return; | |
$weight = $product->get_weight(); | |
if(!empty($weight)){ | |
echo '<br><b class="wt_product_weight">' . __('Weight:', 'woocommerce') . '</b> ' . ($weight . ' ' . get_option('woocommerce_weight_unit') ); | |
} | |
} | |
, 10, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment