3

Default email that is sent when user completes the checkout process contains order number and other details. I want to include additional product details and product type in this email. How can I do that?

1

you can do that by using php code inside text message body.

$wrapper = entity_metadata_wrapper('commerce_order', $commerce_order);
    $line_items =  $wrapper->commerce_line_items->value();
    foreach($line_items as $line_item){
        $product = commerce_product_load($line_item->commerce_product['und'][0]['product_id']);
            echo "Product Title :".$product->title;
            echo "Product Title :".$product->type;
     }
|improve this answer|||||
0

You want the Commerce Message module and it's dependencies. It includes customer emails with a full order details, including customer profiles and all the products purchased.

|improve this answer|||||
  • Hi joshmiller, I have installed the Commerce Message module, but I cannot find any evidence that it "includes customer emails with a full order details, including customer profiles and all the products purchased". Can you please advise on where and how I can set that up? Seems like Drupal Commerce would include a standard "hey, here's what you just ordered" email like every single other ecommerce website has. I am shocked that it doesn't. – hockey2112 Aug 27 '18 at 19:48
  • Drupal 7 Commerce 1 doesn't include order details in their notification email. If you use Commerce Message, you first have to review rules / maybe enable rules that will trigger the email during the event of your choice. Additionally, you can edit the emails by editing the message templates in the UI by going to the Message's listing page. – joshmiller Sep 5 '18 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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