Skip to content

Commit

Permalink
save changes to order before sending confirmationemail
Browse files Browse the repository at this point in the history
  • Loading branch information
iesus committed Dec 22, 2017
1 parent 1a6900d commit f19a9f7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/code/community/Svea/Checkout/Model/Payment/Acknowledge.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,24 @@ public function acknowledge($quote, $mode, $sveaId)

$svea = Mage::getModel('sveacheckout/Checkout_Api_BuildOrder');
$sveaOrder = $svea->setupCommunication();

$status = Mage::getStoreConfig('payment/SveaCheckout/order_status_after_acknowledge');
$message = $helper->__("Order was acknowledged by Svea.");
$sveaData = new Varien_Object(
$sveaOrder->setCheckoutOrderId((int)$quote->getPaymentReference())->getOrder()
);

if (empty(trim($magentoOrder->getCustomerEmail())) && !empty($sveaData->getData('EmailAddress'))) {
$magentoOrder->setCustomerEmail($sveaData->getData('EmailAddress'));
}

$status = Mage::getStoreConfig('payment/SveaCheckout/order_status_after_acknowledge');
$message = $helper->__("Order was acknowledged by Svea.");

$appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);

$magentoOrder
->setState(Mage_Sales_Model_Order::STATE_NEW, $status, $message, false)
->save();
$magentoOrder->getSendConfirmation(null);

if (empty(trim($magentoOrder->getCustomerEmail())) && !empty($sveaData->getData('EmailAddress'))) {
$magentoOrder->setCustomerEmail($sveaData->getData('EmailAddress'));
}

$magentoOrder->sendNewOrderEmail();

$orderQueueItem = Mage::getModel('sveacheckout/queue')->load($quote->getId(), 'quote_id');
Expand Down

0 comments on commit f19a9f7

Please sign in to comment.