0

The email message shows items in cart like this:

Items
Item name x 2 EUR 2
Item 2 name x 1 EUR 3
Item 3 name x 30 EUR 4

How to add the product sku there? Like:

Items
Item name (sku1) x 2 EUR 2
Item 2 name (sku2) x 1 EUR 3
Item 3 name (sku3) x 30 EUR 4

In email template it is done like this: <p> <b>Items</b><br /> {{var items}} </p>
But how to edit the way the {{var items}} -part prints out?

0

Take a look at sendPaymentFailedEmail() in /app/code/core/Mage/Checkout/Helper/Data.php which is call from /app/code/core/Mage/Checkout/controllers/OnepageController.php

The only email variables are :

array(
    'reason' => $message,
    'checkoutType' => $checkoutType,
    'dateAndTime' => Mage::app()->getLocale()->date(),
    'customer' => $checkout->getCustomerFirstname() . ' ' . $checkout->getCustomerLastname(),
    'customerEmail' => $checkout->getCustomerEmail(),
    'billingAddress' => $checkout->getBillingAddress(),
    'shippingAddress' => $checkout->getShippingAddress(),
    'shippingMethod' => Mage::getStoreConfig('carriers/'.$shippingMethod.'/title'),
    'paymentMethod' => Mage::getStoreConfig('payment/'.$paymentMethod.'/title'),
    'items' => nl2br($items),  **<-- display items in your template**
    'total' => $total
)

Since there are no observer trigger your only option would be to do a rewrite and modify this code below accordingly to include sku

foreach ($checkout->getAllVisibleItems() as $_item) {
    /* @var $_item Mage_Sales_Model_Quote_Item */
    $items .= $_item->getProduct()->getName() . '  x '. $_item->getQty() . '  '
            . $checkout->getStoreCurrencyCode() . ' '
            . $_item->getProduct()->getFinalPrice($_item->getQty()) . "\n";
}

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.