Woocommerce Display Custom Field value on the Email [Custom Field Display 3]
/**
* Display field value on the Email..
* source https://rudrastyh.com/woocommerce/order-meta-in-emails.html
* PHP Custom Feild Value
* @param $order_obj Order Object
* @param $sent_to_admin If this email is for administrator or for a customer
* @param $plain_text HTML or Plain text (can be configured in WooCommerce > Settings > Emails)
*
*/
add_action( 'woocommerce_email_order_meta', 'misha_add_email_order_meta', 10, 3 );
function misha_add_email_order_meta( $order_obj, $sent_to_admin, $plain_text ){
// ok, if it is the gift order, get all the other fields
$gift_wrap = get_post_meta( $order_obj->get_order_number(), 'My Field', true );
// you shouldn't have to worry about inline styles, WooCommerce adds them itself depending on the theme you use
echo '<h2>Store Location</h2>
<ul>
<li><strong>Your Store Location is:</strong> ' . $gift_wrap . '</li>
</ul>';
}
Also in PHP:
- create new laravel 7 project
- add x amount of days to a date php
- Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 18874368 bytes) in phar:///opt/cpanel/composer/bin/composer/src/Composer/Repository/ComposerRepository.php on line 588
- drop column migration laravel
- Allowed memory size of 134217728 bytes exhausted laravel
- can't see php7 in my mac
- clear application cache in mac LARAVEL
- eloquent where in
- check if key array php
- check chartercount in php
- $db new PDO php
- console rint in php method
- array sort unique laravel
- current timestamp with sec in php to strstring
- currentdate timestamp php
- Laravel Validation check array size min and max
- april 6 2010 date format php
- echo day php
- array_key_exists php to python
- Parse error</b>: syntax error, unexpected ':', expecting ';' or '{' in <b>//twilio-php-master/src/Twilio/autoload.php</b> on line <b>61</b><br />
- clear specific cache laravel 6
- run php artisan cache:clear
- date format in php for AM PM
- extend php maximum execution time