Two Possible Noob Apply_Filters Question

Bring Your Business to LifeSupportImage StoreTwo Possible Noob Apply_Filters Question

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #56940
    jcharris
    Participant

    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

    #56957
    Xpark Media
    Keymaster

    @jcharris,

    try 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 );
    #56974
    jcharris
    Participant

    I think this is what I need for now.

    Thanks!

    —JC

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.