Bring Your Business to Life › Support › Image Store › How To Add Detailed Receipt For E-Mail Only Checkout
- AuthorPosts
- January 16, 2014 at 8:55 pm #56768
Xpark Media
KeymasterYou 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.
February 19, 2014 at 2:32 pm #56938jcharris
ParticipantThanks 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
February 22, 2014 at 10:24 am #56955Xpark Media
KeymasterYou 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; }
- AuthorPosts
- You must be logged in to reply to this topic.