Bring Your Business to Life › Support › Image Store › Two Possible Noob Apply_Filters Question
- AuthorPosts
- February 20, 2014 at 3:07 pm #56940jcharrisParticipant
1. I want to hook into the e-mail hook ‘ims_customer_message’ and add some text to the e-mail sent to the customer.
I have a plug-in with the following code:
add_filter(‘ims_customer_message’,’jch_test_function’ );
function jch_test_function($message)
{
return $message . ‘ Thanks for ordering.’;
}This doesn’t do anything. What am I doing wrong?
2. Same hook. I want to be able to access the object which holds the contents of the public $cart (line item info) array. How can I pass that to my add_filter function?
add_filter(‘ims_customer_message’,’jch_test_function’ );
function jch_test_function($message, $cart)
// I’m sure this is wrong… just for example.
{
var_dump($cart);
return $message . $cart;
}TIA,
—JC
February 22, 2014 at 10:35 am #56957Xpark MediaKeymastertry this, also be sure that you have the customer message enable under settings > checkout > Email receipt.
function jch_test_function( $message, $email_tags ){ global $ImStoreCart; $message . print_r( $ImStoreCart->cart, true ); return $message ; } add_filter( 'ims_customer_message', 'jch_test_function', 50, 2 );
February 25, 2014 at 10:38 am #56974jcharrisParticipantI think this is what I need for now.
Thanks!
—JC
- AuthorPosts
- You must be logged in to reply to this topic.