0

I want to add delivery data to order emails which will be 7 days after the order is created. Inside Mage_Sales_Model_Order::getCreatedAtFormated() function, following code returns order created date like November 29, 2015 7:04:52 PM IST

Mage::helper('core')->formatDate($this->getCreatedAtStoreDate(), $format, true);

If I'm using Mage::helper('core')->formatDate($this->getCreatedAtStoreDate()+(7*24*60*60), $format, true);, it's not returning correct result.

2
  • Can you include what it is returning?
    – Sander Mangel
    Nov 30 '15 at 8:33
  • @SanderMangel: sorry, it returns nothing.
    – amitshree
    Nov 30 '15 at 8:43
1

You can get order date with:

$date = Mage::app()->getLocale()->storeDate(
    $order->getStore(),
    Varien_Date::toTimestamp($order->getCreatedAt()) + (7*24*60*60),
    true,
    $format
);

Where $format is optional.

Assuming that the $order is Mage_Sales_Model_Order instance, the $date is Zend_Date instance which could be easily casted to string.

0

Need an customer email from the last 7 days through the created date

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.