mirror of
https://github.com/retailcrm/prestashop-module.git
synced 2025-03-03 19:53:19 +03:00
transfer status and bug fixes (#13)
This commit is contained in:
parent
04a084f94f
commit
b6f010f2fc
@ -293,33 +293,6 @@ if ($history->isSuccessful() && count($history->history) > 0) {
|
|||||||
} else {
|
} else {
|
||||||
$orderToUpdate = new Order((int) $order['externalId']);
|
$orderToUpdate = new Order((int) $order['externalId']);
|
||||||
|
|
||||||
/*
|
|
||||||
* check status
|
|
||||||
*/
|
|
||||||
if(!empty($order['status'])) {
|
|
||||||
$stype = $order['status'];
|
|
||||||
|
|
||||||
if ($statuses[$stype] != null) {
|
|
||||||
if ($statuses[$stype] != $orderToUpdate->current_state) {
|
|
||||||
Db::getInstance()->execute('
|
|
||||||
INSERT INTO `' . _DB_PREFIX_ . 'order_history` (`id_employee`, `id_order`, `id_order_state`, `date_add`)
|
|
||||||
VALUES (
|
|
||||||
0,
|
|
||||||
' . $orderToUpdate->id . ',
|
|
||||||
' . $statuses[$stype] . ',
|
|
||||||
"' . date('Y-m-d H:i:s') . '"
|
|
||||||
)
|
|
||||||
');
|
|
||||||
|
|
||||||
Db::getInstance()->execute('
|
|
||||||
UPDATE `' . _DB_PREFIX_ . 'orders`
|
|
||||||
SET `current_state` = \'' . $statuses[$stype] . '\'
|
|
||||||
WHERE `id_order` = ' . (int)$order['externalId']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* check delivery type
|
* check delivery type
|
||||||
*/
|
*/
|
||||||
@ -574,6 +547,34 @@ if ($history->isSuccessful() && count($history->history) > 0) {
|
|||||||
|
|
||||||
unset($ItemDiscount);
|
unset($ItemDiscount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* check status
|
||||||
|
*/
|
||||||
|
if(!empty($order['status'])) {
|
||||||
|
$stype = $order['status'];
|
||||||
|
|
||||||
|
if ($statuses[$stype] != null) {
|
||||||
|
if ($statuses[$stype] != $orderToUpdate->current_state) {
|
||||||
|
Db::getInstance()->execute('
|
||||||
|
INSERT INTO `' . _DB_PREFIX_ . 'order_history` (`id_employee`, `id_order`, `id_order_state`, `date_add`)
|
||||||
|
VALUES (
|
||||||
|
0,
|
||||||
|
' . $orderToUpdate->id . ',
|
||||||
|
' . $statuses[$stype] . ',
|
||||||
|
"' . date('Y-m-d H:i:s') . '"
|
||||||
|
)
|
||||||
|
');
|
||||||
|
|
||||||
|
Db::getInstance()->execute('
|
||||||
|
UPDATE `' . _DB_PREFIX_ . 'orders`
|
||||||
|
SET `current_state` = \'' . $statuses[$stype] . '\'
|
||||||
|
WHERE `id_order` = ' . (int)$order['externalId']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -395,8 +395,8 @@ class RetailCRM extends Module
|
|||||||
$address = array_shift($addressCollection);
|
$address = array_shift($addressCollection);
|
||||||
|
|
||||||
if ($address instanceof Address) {
|
if ($address instanceof Address) {
|
||||||
$phone = is_null($address->phone)
|
$phone = empty($address->phone)
|
||||||
? is_null($address->phone_mobile) ? '' : $address->phone_mobile
|
? empty($address->phone_mobile) ? '' : $address->phone_mobile
|
||||||
: $address->phone;
|
: $address->phone;
|
||||||
|
|
||||||
$postcode = $address->postcode;
|
$postcode = $address->postcode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user