diff --git a/CHANGELOG.md b/CHANGELOG.md index 29f80574..92ab3aa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## v3.6.0 +* Добавлена поддержка PrestaShop 1.7.8.10 + ## v3.5.8 * Реализована передача характеристик товара в ICML каталог diff --git a/VERSION b/VERSION index fa8da207..40c341bd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.5.8 +3.6.0 diff --git a/retailcrm/lib/RetailcrmHistory.php b/retailcrm/lib/RetailcrmHistory.php index 4027162e..7e219f77 100755 --- a/retailcrm/lib/RetailcrmHistory.php +++ b/retailcrm/lib/RetailcrmHistory.php @@ -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']; diff --git a/retailcrm/lib/exceptions/RetailcrmJobManagerException.php b/retailcrm/lib/exceptions/RetailcrmJobManagerException.php index 1624f533..7ecfa9ee 100644 --- a/retailcrm/lib/exceptions/RetailcrmJobManagerException.php +++ b/retailcrm/lib/exceptions/RetailcrmJobManagerException.php @@ -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); diff --git a/retailcrm/retailcrm.php b/retailcrm/retailcrm.php index f03ba6fd..e4f424a7 100755 --- a/retailcrm/retailcrm.php +++ b/retailcrm/retailcrm.php @@ -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'; @@ -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`'); } /** diff --git a/upgrade/upgrade-build b/upgrade/upgrade-build old mode 100755 new mode 100644