mirror of
https://github.com/retailcrm/prestashop-module.git
synced 2025-03-01 19:03:14 +03:00
parent
5a899f6b2a
commit
3110960d06
@ -1,3 +1,6 @@
|
|||||||
|
## v3.5.1
|
||||||
|
* Обновление формата даты в корзинах
|
||||||
|
|
||||||
## v3.5.0
|
## v3.5.0
|
||||||
* Реализована поддержка новой логики работы с брошенными корзинами.
|
* Реализована поддержка новой логики работы с брошенными корзинами.
|
||||||
|
|
||||||
|
@ -76,6 +76,11 @@ class RetailcrmCartUploader
|
|||||||
*/
|
*/
|
||||||
static $now;
|
static $now;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
static $crmCartDateFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cast provided sync delay to integer
|
* Cast provided sync delay to integer
|
||||||
*
|
*
|
||||||
@ -101,6 +106,7 @@ class RetailcrmCartUploader
|
|||||||
static::$allowedUpdateInterval = 86400;
|
static::$allowedUpdateInterval = 86400;
|
||||||
static::$now = new DateTimeImmutable();
|
static::$now = new DateTimeImmutable();
|
||||||
static::$context = Context::getContext();
|
static::$context = Context::getContext();
|
||||||
|
static::$crmCartDateFormat = 'Y-m-d H:i:sP';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -148,7 +154,7 @@ class RetailcrmCartUploader
|
|||||||
if ($isExistExternalId) {
|
if ($isExistExternalId) {
|
||||||
static::$api->cartClear(
|
static::$api->cartClear(
|
||||||
[
|
[
|
||||||
'clearedAt' => date('Y-m-d H:i:s'),
|
'clearedAt' => date(static::$crmCartDateFormat),
|
||||||
'customer' => ['externalId' => $cart->id_customer],
|
'customer' => ['externalId' => $cart->id_customer],
|
||||||
],
|
],
|
||||||
static::$site
|
static::$site
|
||||||
@ -256,7 +262,7 @@ class RetailcrmCartUploader
|
|||||||
$crmCart = [
|
$crmCart = [
|
||||||
'customer' => ['externalId' => $cart->id_customer],
|
'customer' => ['externalId' => $cart->id_customer],
|
||||||
'clearAt' => null,
|
'clearAt' => null,
|
||||||
'createdAt' => $cart->date_add,
|
'createdAt' => DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $cart->date_add)->format(static::$crmCartDateFormat),
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!$isExistExternalId) {
|
if (!$isExistExternalId) {
|
||||||
@ -264,7 +270,7 @@ class RetailcrmCartUploader
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($cart->date_upd)) {
|
if (!empty($cart->date_upd)) {
|
||||||
$crmCart['updatedAt'] = $cart->date_upd;
|
$crmCart['updatedAt'] = DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $cart->date_upd)->format(static::$crmCartDateFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
$products = $cart->getProducts();
|
$products = $cart->getProducts();
|
||||||
@ -280,7 +286,7 @@ class RetailcrmCartUploader
|
|||||||
: $product['id_product'],
|
: $product['id_product'],
|
||||||
],
|
],
|
||||||
'quantity' => $product['cart_quantity'],
|
'quantity' => $product['cart_quantity'],
|
||||||
'createdAt' => $product['date_add'],
|
'createdAt' => DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $product['date_add'])->format(static::$crmCartDateFormat),
|
||||||
'price' => !empty($product['rate'])
|
'price' => !empty($product['rate'])
|
||||||
? round($product['price'], 2) + (round($product['price'], 2) * $product['rate'] / 100)
|
? round($product['price'], 2) + (round($product['price'], 2) * $product['rate'] / 100)
|
||||||
: round($product['price'], 2),
|
: round($product['price'], 2),
|
||||||
|
@ -48,7 +48,7 @@ require_once dirname(__FILE__) . '/bootstrap.php';
|
|||||||
|
|
||||||
class RetailCRM extends Module
|
class RetailCRM extends Module
|
||||||
{
|
{
|
||||||
const VERSION = '3.5.0';
|
const VERSION = '3.5.1';
|
||||||
|
|
||||||
const API_URL = 'RETAILCRM_ADDRESS';
|
const API_URL = 'RETAILCRM_ADDRESS';
|
||||||
const API_KEY = 'RETAILCRM_API_TOKEN';
|
const API_KEY = 'RETAILCRM_API_TOKEN';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user