Skip to content

Commit

Permalink
order id fix
Browse files Browse the repository at this point in the history
  • Loading branch information
margud committed Aug 6, 2020
1 parent 4176328 commit 1be022b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion controllers/front/payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ public function initContent()
$this->createOrder($method, $apiPayment, $cart->id, $originalAmount, $customer->secure_key, $orderReference);
$orderReference = isset($apiPayment->metadata->order_reference) ? pSQL($apiPayment->metadata->order_reference) : '';

$order = Order::getOrderByCartId($cart->id);
$orderId = Order::getOrderByCartId($cart->id);
$order = new Order($orderId);
if ($apiPayment->method !== PaymentMethod::BANKTRANSFER) {
try {
Db::getInstance()->insert(
Expand Down
6 changes: 4 additions & 2 deletions mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,8 @@ public function hookActionEmailSendBefore($params)
}

$cart = new Cart($params['cart']->id);
$order = Order::getOrderByCartId($cart->id);
$orderId = Order::getOrderByCartId($cart->id);
$order = new Order($orderId);
if ($order === null || $order->module !== $this->name) {
return true;
}
Expand Down Expand Up @@ -1166,7 +1167,8 @@ public function hookActionEmailSendBefore($params)
$params['template'] === 'outofstock' ||
$params['template'] === 'bankwire' ||
$params['template'] === 'refund') {
$order = Order::getOrderByCartId($cart->id);
$orderId = Order::getOrderByCartId($cart->id);
$order = new Order($orderId);
if (!$order) {
return true;
}
Expand Down

0 comments on commit 1be022b

Please sign in to comment.