Skip to content

Commit

Permalink
Добавлена передача поля link для брошенных корзин (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
uryvskiy-dima authored Jul 17, 2024
1 parent d6862ba commit d078202
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v3.6.6
* Добавлена передача поля link при выгрузке брошенных корзин

## v3.6.5
* Исправлено дублирование товаров при обратной синхронизации

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.5
3.6.6
10 changes: 10 additions & 0 deletions retailcrm/lib/RetailcrmCartUploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ private static function buildCrmCart($cart, string $cartExternalId, bool $isExis
'customer' => ['externalId' => $cart->id_customer],
'clearAt' => null,
'createdAt' => DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $cart->date_add)->format(static::$crmCartDateFormat),
'link' => self::generateCartLink(),
];

if (!$isExistExternalId) {
Expand Down Expand Up @@ -447,4 +448,13 @@ private static function populateContextWithEmployee($employee)
{
self::$context->employee = $employee;
}

public static function generateCartLink()
{
return sprintf(
'%s://%s/index.php?controller=cart&action=show',
!empty($_SERVER['HTTPS']) ? 'https' : 'http',
$_SERVER['HTTP_HOST']
);
}
}
2 changes: 1 addition & 1 deletion retailcrm/retailcrm.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

class RetailCRM extends Module
{
const VERSION = '3.6.5';
const VERSION = '3.6.6';

const API_URL = 'RETAILCRM_ADDRESS';
const API_KEY = 'RETAILCRM_API_TOKEN';
Expand Down

0 comments on commit d078202

Please sign in to comment.