0

Is it possible to create different notifications for different products on CartThrob? I have products I'm selling in a products channel and services which are also offered that's within another channel. I would like the successful transaction of the products to shoot a different email notification than the service purchase, but I can't differentiate the two different orders because there's only "successful transaction" as the trigger. Any help on this would be greatly appreciated! Thanks!

1 Answer 1

0

(I'm with Vector; we own CartThrob)

There are two ways to do this, depending on how much customization you need:

  1. You can use conditionals inside the order notification template. Something like {if channel_id == '2'}{/if} (of the purchased item) in the code, and then have different content based on that.
  2. For a lot more customization you can turn off the default notifications, and use the post-purchase hook with a custom extension to send your own emails. This way you can run through the purchased items and do whatever you need.

Also, is it possible to order both items at once on your site? If so you'll want to think through what happens then.

4
  • Thanks! Currently, I have the following setup on my notification template: {if group_id=="1" OR "ORDER_ID" != ""} {exp:cartthrob:submitted_order_info} ALL THE CONFIRMATION INFO {/exp:cartthrob:submitted_order_info} {/if} But would I put the conditional within the exp:carthrob:submitted_order_info like this? {if group_id=="1" OR "ORDER_ID" != ""} {exp:cartthrob:submitted_order_info} {if channel_id == "1"} ALL THE CONFIRMATION INFO {/if} {if channel_id == "2"} ALL THE CONFIRMATION INFO {/if} {/exp:cartthrob:submitted_order_info} {/if}
    – user3092
    Commented Feb 11, 2016 at 20:53
  • @user3092 I think you should use exp:channel:entries with entry_id="{order_id}" instead of submitted_order_info. Then you can put the conditionals wherever.
    – Matt
    Commented Feb 12, 2016 at 20:57
  • I tried this, but adding the conditional {if channel_id == "1"} under exp:channel:entries doesn't seem to work. Nothing outputs when I wrap things with the conditional. Any idea?
    – user3092
    Commented Feb 22, 2016 at 23:24
  • The e:c:e loop there is going to be for the order itself. You'll want to use a combination of exp:cartthrob:order_items inside of there along with passing the entry_id to possibly further e:c:e loops/embeds after, and set your conditionals there, on the ordered item, not the order itself.
    – Matt
    Commented Feb 24, 2016 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.