mirror of
https://github.com/retailcrm/prestashop-module.git
synced 2025-03-01 19:03:14 +03:00
Fixed error in abandoned carts for PS below 1.7.1 version
This commit is contained in:
parent
f4984faa43
commit
520149394e
@ -675,12 +675,16 @@ class RetailCRM extends Module
|
||||
if ($response !== false && isset($response['order'])) {
|
||||
$externalId = RetailcrmTools::getCartOrderExternalId($params['cart']);
|
||||
} else {
|
||||
$order = Order::getByCartId($params['cart']->id);
|
||||
if (version_compare(_PS_VERSION_, '1.7.1.0', '>=')) {
|
||||
$id_order = (int)Order::getIdByCartId((int)$params['cart']->id);
|
||||
} else {
|
||||
$id_order = (int)Order::getOrderByCartId((int)$params['cart']->id);
|
||||
}
|
||||
|
||||
if($order !== null) {
|
||||
$response = $this->api->ordersGet($order->id);
|
||||
if ($id_order > 0) {
|
||||
$response = $this->api->ordersGet($id_order);
|
||||
if ($response !== false && isset($response['order'])) {
|
||||
$externalId = $order->id;
|
||||
$externalId = $id_order;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user