How To Add Detailed Receipt For E-Mail Only Checkout

Bring Your Business to LifeSupportImage StoreHow To Add Detailed Receipt For E-Mail Only Checkout

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #56756
    jcharris
    Participant

    Hi,

    As you know, I’ve been reviewing ImageStore for a client. The big hurdle we have is that we need to send a detailed e-mail receipt to the visitor after they checkout even though they are NOT paying.

    Want a logged in visitor to be able to add items to the cart and hit the checkout button but without using a payment gateway. And we want the e-mail receipt to include a list of the items they added to the cart WITH download links.

    Is there a filter or hook that allows me to override the behaviour of checkout and do this without re-writing the cart.php? This is -critical- for us.

    TIA,

    —JC

    #56768
    Xpark Media
    Keymaster

    @jcharris,

    You can removed or add checkout buttons base on the user status using the ims_checkout_actions hook.

    To completely modify the email sent to the customer you can use the ims_customer_message hook.

    #56938
    jcharris
    Participant

    Thanks for the reply. I looked at the ims_customer_message hook.

    But it looks like the download links object is only populated with the items they ordered if a payment gateway is selected.

    So… AGAIN… sorry if this is a stupid question, but can you give a (brief) example of how I would pass the list of ordered items to ‘ims_customer_message’?

    TIA,

    —JC

    #56955
    Xpark Media
    Keymaster

    @jcharris,

    You can generate the links to the images yourself in the ims_customer_message hook. In the function all you have to return is html.

    And since you don’t need to validate payment you don’t need to pass the links to the download.php script.

    but if you still need to use the download script this is how you do it.

    function my_ims_customer_message_function(){
    global $ImStore, $ImStoreCart;
    $message = '<p>start html message</p>';
    foreach ( $ImStoreCart->cart['images'] as $id => $sizes ) {
    $enc = $ImStore->url_encrypt( $id );
    foreach ( $sizes as $size => $colors ) {
    foreach ($colors as $color => $item) {
    if ( $item['download'] )
    $message  .= '<a href="' . esc_attr( IMSTORE_ADMIN_URL ) . "/download.php?$nonce&img=" .
    $enc . "&sz=$size&c=" . $item['color_code'] . '" class="ims-download">' .
    esc_html( get_the_title( $id ) . " " . $item['color_name'] ) . "</a>";
    }
    }
    }
    $message .= '<p>finish html message</p>';
    return $message;
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.