Skip to content

Commit

Permalink
ref #79031 Added support for PrestaShop 1.7.8.10
Browse files Browse the repository at this point in the history
  • Loading branch information
uryvskiy-dima committed Sep 20, 2023
1 parent 05e332c commit af11522
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 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.0
* Добавлена поддержка PrestaShop 1.7.8.10

## v3.5.8
* Реализована передача характеристик товара в ICML каталог

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.8
3.6.0
5 changes: 1 addition & 4 deletions retailcrm/lib/RetailcrmHistory.php
Original file line number Diff line number Diff line change
Expand Up @@ -1890,10 +1890,7 @@ private static function setOutOfStockStatusInCrm($crmOrder, $prestashopOrder, $q

private static function getPrestashopOutOfStockStatusFromModuleConfig(array $crmOrder)
{
$statusArray = json_decode(
Configuration::get(RetailCRM::OUT_OF_STOCK_STATUS),
true
);
$statusArray = json_decode(Configuration::get(RetailCRM::OUT_OF_STOCK_STATUS), true);

if (!empty($crmOrder['fullPaidAt'])) {
return $statusArray['out_of_stock_paid'];
Expand Down
4 changes: 2 additions & 2 deletions retailcrm/lib/exceptions/RetailcrmJobManagerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ class RetailcrmJobManagerException extends Exception
* @param string $job
* @param array $jobs
* @param int $code
* @param \Exception|null $previous
* @param $previous
*/
public function __construct($message = '', $job = '', $jobs = [], $code = 0, Exception $previous = null)
public function __construct($message = '', $job = '', $jobs = [], $code = 0, $previous = null)
{
parent::__construct($message, $code, $previous);

Expand Down
22 changes: 13 additions & 9 deletions 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.5.8';
const VERSION = '3.6.0';

const API_URL = 'RETAILCRM_ADDRESS';
const API_KEY = 'RETAILCRM_API_TOKEN';
Expand Down Expand Up @@ -387,32 +387,36 @@ public function disable($force_all = false)

public function installDB()
{
return Db::getInstance()->execute(
$resultQuery1 = Db::getInstance()->execute(
'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'retailcrm_abandonedcarts` (
`id_cart` INT UNSIGNED UNIQUE NOT NULL,
`last_uploaded` DATETIME,
FOREIGN KEY (id_cart) REFERENCES ' . _DB_PREFIX_ . 'cart (id_cart)
FOREIGN KEY (id_cart) REFERENCES `' . _DB_PREFIX_ . 'cart` (`id_cart`)
ON DELETE CASCADE
ON UPDATE CASCADE
) DEFAULT CHARSET=utf8;
) DEFAULT CHARSET=utf8;');


$resultQuery2 = Db::getInstance()->execute('
CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'retailcrm_exported_orders` (
`id_order` INT UNSIGNED UNIQUE NULL,
`id_order_crm` INT UNSIGNED UNIQUE NULL,
`errors` TEXT NULL,
`last_uploaded` DATETIME,
FOREIGN KEY (id_order) REFERENCES ' . _DB_PREFIX_ . 'orders (id_order)
FOREIGN KEY (id_order) REFERENCES `' . _DB_PREFIX_ . 'orders` (`id_order`)
ON DELETE CASCADE
ON UPDATE CASCADE
) DEFAULT CHARSET=utf8;'
);


return $resultQuery1 && $resultQuery2;
}

public function uninstallDB()
{
return Db::getInstance()->execute(
'DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'retailcrm_abandonedcarts`;
DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'retailcrm_exported_orders`;'
);
return Db::getInstance()->execute('DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'retailcrm_abandonedcarts`')
&& Db::getInstance()->execute('DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'retailcrm_exported_orders`');
}

/**
Expand Down
Empty file modified upgrade/upgrade-build
100755 → 100644
Empty file.

0 comments on commit af11522

Please sign in to comment.