From d57bc081422bf5058a6daee4b16067ce20e0a293 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 10:44:52 +0200 Subject: [PATCH] chore(main): release 3.5.7 (#28) * chore(main): release 3.5.6 * misc(plugin): update prestashop plugin version and chercksum * misc(standards): fix prestashop plugin standards for module validation * misc(readme): update readme * misc(product): check index in LengowProduct * misc(checksum): update checksum * misc(standard): fix standards and update checksum * chore(main): release 3.5.7 * misc(checksum): Update md5 checksums * misc(conflicts): fix conflicts * misc(checksum): update the checksum * misc(standard): fix prestashop standard * misc(install): fix compatibility prestashop version * misc(checksum): update checksum for lengow.php --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Alexis Hermanns Co-authored-by: vagrant --- CHANGELOG.md | 18 ++++++++ README.md | 2 +- classes/models/LengowCarrier.php | 15 ++----- classes/models/LengowCart.php | 15 +------ classes/models/LengowConnector.php | 11 +++-- classes/models/LengowMethod.php | 15 ++----- classes/models/LengowOrder.php | 7 +-- classes/models/LengowOrderError.php | 7 +-- classes/models/LengowPaymentModule.php | 16 +------ composer.json | 2 +- config/checkmd5.csv | 20 ++++----- lengow.php | 62 ++------------------------ 12 files changed, 54 insertions(+), 136 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0ca1741..9af486f2 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,24 @@ # Changelog +<<<<<<< HEAD +======= +## [3.5.7](https://github.com/lengow/plugin-prestashop/compare/v3.5.6...v3.5.7) (2024-10-10) + + +### Bug Fixes + +* **connector:** [ECP-112] rate limit request for prestashop ([#27](https://github.com/lengow/plugin-prestashop/issues/27)) ([6395ed9](https://github.com/lengow/plugin-prestashop/commit/6395ed9a6bc5f69abcafdf45cf65ee424f41b72a)) +* **cron:** don't crash when (canceled) product have 0 qty ([#29](https://github.com/lengow/plugin-prestashop/issues/29)) ([2047093](https://github.com/lengow/plugin-prestashop/commit/2047093666143f6514a5ffb9c109c4dd1e684036)) +* **orders:** [PST-21861] fix extra field cut by the char ([#30](https://github.com/lengow/plugin-prestashop/issues/30)) ([154ba64](https://github.com/lengow/plugin-prestashop/commit/154ba6456e709c9f7317e05bcf1224294116da74)) + + +### Miscellaneous + +* **ci-cd:** automatically update release-please version in files ([#25](https://github.com/lengow/plugin-prestashop/issues/25)) ([ff16ff8](https://github.com/lengow/plugin-prestashop/commit/ff16ff85a59881dc2c471a533bc44bce596347dd)) +* **cicd:** Add a CI job to generate plugin checksums ([#26](https://github.com/lengow/plugin-prestashop/issues/26)) ([54e705b](https://github.com/lengow/plugin-prestashop/commit/54e705bc190dcbdd755d83a89c965dea0baa3195)) + +>>>>>>> 6f02e41d8931dfe52501e9e4978bca0dbe05bc3a ## [3.5.6](https://github.com/lengow/plugin-prestashop/compare/v3.5.5...v3.5.6) (2024-09-23) diff --git a/README.md b/README.md index 184bbad8..4fddfc9b 100755 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ - **Requires at least:** 1.7.7 - **Tested up to:** 8.1.7 - **Requires PHP:** 7.4 -- **Stable tag:** 3.5.6 +- **Stable tag:** 3.5.7 - **License:** Apache-2.0 - **License URI:** http://www.apache.org/licenses/LICENSE-2.0 diff --git a/classes/models/LengowCarrier.php b/classes/models/LengowCarrier.php index f1b19d75..7c425b5c 100755 --- a/classes/models/LengowCarrier.php +++ b/classes/models/LengowCarrier.php @@ -501,11 +501,8 @@ public static function syncCarrierMarketplace() * * @return int|false */ - public static function insertCarrierMarketplace( - $carrierMarketplaceName, - $carrierMarketplaceLabel, - $carrierLengowCode = null - ) { + public static function insertCarrierMarketplace($carrierMarketplaceName, $carrierMarketplaceLabel, $carrierLengowCode = null) + { $params = [ self::FIELD_CARRIER_MARKETPLACE_NAME => pSQL($carrierMarketplaceName), self::FIELD_CARRIER_MARKETPLACE_LABEL => pSQL($carrierMarketplaceLabel), @@ -968,12 +965,8 @@ public static function getAllMarketplaceCarrierCountryByIdMarketplace($idCountry * * @return int|false */ - public static function insertMarketplaceCarrierCountry( - $idCountry, - $idMarketplace, - $idCarrier, - $idCarrierMarketplace - ) { + public static function insertMarketplaceCarrierCountry($idCountry, $idMarketplace, $idCarrier, $idCarrierMarketplace) + { $params = [ self::FIELD_COUNTRY_ID => (int) $idCountry, self::FIELD_MARKETPLACE_ID => (int) $idMarketplace, diff --git a/classes/models/LengowCart.php b/classes/models/LengowCart.php index 95f18046..26a24f9f 100755 --- a/classes/models/LengowCart.php +++ b/classes/models/LengowCart.php @@ -104,19 +104,8 @@ public function cleanCart($products = []) * * @throws Exception|PrestaShopDatabaseException */ - public function updateQty( - $quantity, - $idProduct, - $idProductAttribute = null, - $idCustomization = false, - $operator = 'up', - $idAddressDelivery = 0, - ?Shop $shop = null, - $autoAddCartRule = true, - $skipAvailabilityCheckOutOfStock = false, - $preserveGiftRemoval = true, - $useOrderPrices = false - ) { + public function updateQty($quantity, $idProduct, $idProductAttribute = null, $idCustomization = false, $operator = 'up', $idAddressDelivery = 0, ?Shop $shop = null, $autoAddCartRule = true, $skipAvailabilityCheckOutOfStock = false, $preserveGiftRemoval = true, $useOrderPrices = false) + { if (!$shop) { $shop = Context::getContext()->shop; } diff --git a/classes/models/LengowConnector.php b/classes/models/LengowConnector.php index f3d37c1a..1fce1ceb 100755 --- a/classes/models/LengowConnector.php +++ b/classes/models/LengowConnector.php @@ -456,8 +456,7 @@ private function callAction($api, $args, $type, $format, $body, $logOutput) */ private function rateLimitingRequests(string $api): void { - - switch($api) { + switch ($api) { case self::API_ORDER: $wait = $this->getWaitLimitOrderRequests(); break; @@ -491,13 +490,13 @@ private function getWaitLimitOrderRequests(): ?int if (is_null($timeStart)) { $timeStart = time(); } - $nbRequest++; + ++$nbRequest; if ($nbRequest >= self::REQUEST_LIMIT) { $timeDiff = time() - $timeStart; $nbRequest = 0; $timeStart = time(); if ($timeDiff < 60) { - return (60 - $timeDiff); + return 60 - $timeDiff; } } @@ -514,13 +513,13 @@ private function getWaitLimitActionRequests(): ?int if (is_null($timeStart)) { $timeStart = time(); } - $nbRequest++; + ++$nbRequest; if ($nbRequest >= self::REQUEST_LIMIT) { $timeDiff = time() - $timeStart; $nbRequest = 0; $timeStart = time(); if ($timeDiff < 60) { - return (60 - $timeDiff); + return 60 - $timeDiff; } } diff --git a/classes/models/LengowMethod.php b/classes/models/LengowMethod.php index 66f302bc..5b894d76 100755 --- a/classes/models/LengowMethod.php +++ b/classes/models/LengowMethod.php @@ -163,11 +163,8 @@ public static function syncMethodMarketplace() * * @return int|false */ - public static function insertMethodMarketplace( - $methodMarketplaceName, - $methodMarketplaceLabel, - $methodLengowCode = null - ) { + public static function insertMethodMarketplace($methodMarketplaceName, $methodMarketplaceLabel, $methodLengowCode = null) + { $params = [ self::FIELD_METHOD_MARKETPLACE_NAME => pSQL($methodMarketplaceName), self::FIELD_METHOD_MARKETPLACE_LABEL => pSQL($methodMarketplaceLabel), @@ -413,12 +410,8 @@ public static function getAllMarketplaceMethodCountryByIdMarketplace($idCountry, * * @return int|false */ - public static function insertMarketplaceMethodCountry( - $idCountry, - $idMarketplace, - $idCarrier, - $idMethodMarketplace - ) { + public static function insertMarketplaceMethodCountry($idCountry, $idMarketplace, $idCarrier, $idMethodMarketplace) + { $params = [ self::FIELD_COUNTRY_ID => $idCountry, self::FIELD_MARKETPLACE_ID => $idMarketplace, diff --git a/classes/models/LengowOrder.php b/classes/models/LengowOrder.php index eecfeb0e..d0b9c138 100644 --- a/classes/models/LengowOrder.php +++ b/classes/models/LengowOrder.php @@ -336,11 +336,8 @@ protected function loadLengowFields() * * @return int|false */ - public static function getOrderIdFromLengowOrders( - $marketplaceSku, - $marketplace, - $marketplaceLegacy - ) { + public static function getOrderIdFromLengowOrders($marketplaceSku, $marketplace, $marketplaceLegacy) + { // v2 compatibility $in = ( $marketplaceLegacy === null diff --git a/classes/models/LengowOrderError.php b/classes/models/LengowOrderError.php index 07439219..89c647be 100644 --- a/classes/models/LengowOrderError.php +++ b/classes/models/LengowOrderError.php @@ -74,11 +74,8 @@ public static function lengowOrderIsInError($idLengowOrder) * * @return array|false */ - public static function getLastImportLogNotFinished( - $marketplaceSku, - $marketplaceName, - $type = self::TYPE_ERROR_IMPORT - ) { + public static function getLastImportLogNotFinished($marketplaceSku, $marketplaceName, $type = self::TYPE_ERROR_IMPORT) + { // check if log already exists for the given order id $query = 'SELECT lli.`message`, lli.`date` FROM `' . _DB_PREFIX_ . 'lengow_logs_import` lli LEFT JOIN `' . _DB_PREFIX_ . 'lengow_orders` lo ON lli.`id_order_lengow` = lo.`id` diff --git a/classes/models/LengowPaymentModule.php b/classes/models/LengowPaymentModule.php index a27ff562..4ae3ea3f 100755 --- a/classes/models/LengowPaymentModule.php +++ b/classes/models/LengowPaymentModule.php @@ -54,20 +54,8 @@ class LengowPaymentModule extends PaymentModule * delivery country not active / product is not listed / unable to save order * unable to save order payment / order creation failed */ - public function makeOrder( - $idCart, - $idOrderState, - $paymentMethod, - $message, - $lengowProducts, - $lengowShippingCosts, - $processingFees, - $lengowTrackingNumber, - $idOrderLengow, - $orderStateLengow, - $marketplaceSku, - $logOutput - ) { + public function makeOrder($idCart, $idOrderState, $paymentMethod, $message, $lengowProducts, $lengowShippingCosts, $processingFees, $lengowTrackingNumber, $idOrderLengow, $orderStateLengow, $marketplaceSku, $logOutput) + { if (!isset($this->context)) { $this->context = Context::getContext(); } diff --git a/composer.json b/composer.json index 722dfa87..46e24216 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "prestashop/lengow", "description": "Lengow", - "version": "3.5.6", + "version": "3.5.7", "autoload": { "psr-4": { "Lengow\\": "src/" diff --git a/config/checkmd5.csv b/config/checkmd5.csv index 37bf048f..25055010 100644 --- a/config/checkmd5.csv +++ b/config/checkmd5.csv @@ -2,7 +2,7 @@ /fr.php|0688c5e6237bf1c4ebf4d8f7a622a794 /index.php|be8b25f88c14bddd7711e4585ebae316 /it.php|14e76520f64429f3436543e904e13015 -/lengow.php|b00b40fe6d900ecd34863812bb0e915d +/lengow.php|2ad4eef9920d888505712030efc1a717 /loader.php|b3d94d65d0a074088758bc1e50736a01 /config/index.php|be8b25f88c14bddd7711e4585ebae316 /translations/en.csv|cf623351741049d7c05788415205a56c @@ -26,7 +26,7 @@ /classes/models/LengowConfigurationForm.php|ba4ba2a08431bf6521c5b48c4a863ef5 /classes/models/LengowCustomer.php|dfb59e7d5a8cb8c47fae3015c66607af /classes/models/LengowSync.php|cf6877bf01e2794b9d9c29989894ae14 -/classes/models/LengowConnector.php|93f0eacbf405a0d504d8685eabf794b2 +/classes/models/LengowConnector.php|97805c39f27ff054889fd7352976fdef /classes/models/LengowLink.php|d658ea39cfbae6deefe2069fd92ad4fa /classes/models/LengowInstall.php|8850827d3b933feadc8d05329cfc0717 /classes/models/LengowException.php|8beecbf00b5c1c047ee19af552903439 @@ -35,18 +35,18 @@ /classes/models/LengowHook.php|94a1cb07d3730a3b2a7339cdeb98a342 /classes/models/LengowGender.php|ea44d0c65c0bef2f1925bd78cf1d91ed /classes/models/LengowToolbox.php|16c719778050e0492cbed92d2adf75e1 -/classes/models/LengowCarrier.php|ec7de4fba34adbbb30cbde3ef9bb59c8 -/classes/models/LengowOrderError.php|a6764f224b3b42fdd5b5c765cef9aaaf -/classes/models/LengowImportOrder.php|6f49ac6363ebe126372b8addfba011cf +/classes/models/LengowCarrier.php|cfcdc17ca503a58ea21cb1e8bfda3ae4 +/classes/models/LengowOrderError.php|ee49194afa24deff08a2c2ea85729747 +/classes/models/LengowImportOrder.php|be3f1d22fff61d3459b3138d1e7959ff /classes/models/LengowOrderLine.php|749e718219adf697b559f88e998860df /classes/models/LengowTranslation.php|a3cf23bc8af338976a392f9d0bb146ca /classes/models/LengowCountry.php|3f0559f5ec914a4cec1ca7848204553b -/classes/models/LengowPaymentModule.php|7b3d642f1ea4d80eb20571f6fbdfddb7 -/classes/models/LengowMethod.php|269ff651d60ba3e2604e3f4ee98ac883 +/classes/models/LengowPaymentModule.php|8f5a695e7dcebefdbf04f4570d011c25 +/classes/models/LengowMethod.php|b5a6f695d06191e20727411205434cab /classes/models/LengowOrderDetail.php|c0ea8445020fc1c49b3d9e7099650d7a /classes/models/LengowMarketplace.php|4b18f91131193a3eee53d2eb917c5b94 -/classes/models/LengowProduct.php|43dbe5291302cf1d1da8c5ed50dd4a2d -/classes/models/LengowCart.php|dd2dc66b0c046a3ef8461807d4432280 +/classes/models/LengowProduct.php|20ef9d516282ffcf8694b0785c4d19e4 +/classes/models/LengowCart.php|e49dd062e79a24c3b7fcfd2499216573 /classes/models/LengowMain.php|68ff3498a94537a51bc5e6b61bd854df /classes/models/LengowList.php|31030820ccfc2ed94bfc5249c72d94f6 /classes/models/LengowOrderCarrier.php|593f0e1ff6bc9611739de14b8f3d192a @@ -59,7 +59,7 @@ /classes/models/LengowToolboxElement.php|20dbd4958f8914acd3d9654b9cde026a /classes/models/LengowImport.php|27c9684c21cd1d34894df9bb3a968ec7 /classes/models/LengowAction.php|c697eb825f2d69baca255d94e0fa79d5 -/classes/models/LengowOrder.php|2ab9808c9ae021b403a94aa8f58a4b9f +/classes/models/LengowOrder.php|3849cf224614e5c9ac232664c915a02f /classes/models/LengowFile.php|5a58b3cf03a99bfeb305abe048799206 /classes/index.php|a90243841e2e64a4ee2965d4dfa12491 /controllers/admin/AdminLengowMainSettingController.php|cb8b24a5405860c955a6e56faba62d08 diff --git a/lengow.php b/lengow.php index 777c84de..5c49a4ad 100755 --- a/lengow.php +++ b/lengow.php @@ -45,11 +45,11 @@ public function __construct() { $this->name = 'lengow'; $this->tab = 'export'; - $this->version = '3.5.6'; // x-release-please-version + $this->version = '3.5.7'; // x-release-please-version $this->author = 'Lengow'; $this->module_key = '__LENGOW_PRESTASHOP_PRODUCT_KEY__'; $this->ps_versions_compliancy = [ - 'min' => '1.7.7.0', + 'min' => '1.7.8', 'max' => '8.99.99', ]; $this->bootstrap = true; @@ -132,14 +132,6 @@ public function hookDisplayBackOfficeHeader() $this->hookClass->hookDisplayBackOfficeHeader(); } - /** - * Hook on Home page - */ - public function hookHome() - { - $this->hookClass->hookHome(); - } - /** * Hook on Home page */ @@ -148,14 +140,6 @@ public function hookDisplayHome() $this->hookClass->hookHome(); } - /** - * Hook on Payment page - */ - public function hookPaymentTop() - { - $this->hookClass->hookPaymentTop(); - } - /** * Hook on Payment page */ @@ -164,16 +148,6 @@ public function hookDisplayPaymentTop() $this->hookClass->hookPaymentTop(); } - /** - * Hook for generate tracker on front footer page - * - * @return mixed - */ - public function hookFooter() - { - return $this->hookClass->hookFooter(); - } - /** * Hook for generate tracker on front footer page * @@ -184,16 +158,6 @@ public function hookDisplayFooter() return $this->hookClass->hookFooter(); } - /** - * Hook on order confirmation page to init order's product list - * - * @param array $args Arguments of hook - */ - public function hookOrderConfirmation($args) - { - $this->hookClass->hookOrderConfirmation($args); - } - /** * Hook on order confirmation page to init order's product list * @@ -204,16 +168,6 @@ public function hookDisplayOrderConfirmation($args) $this->hookClass->hookOrderConfirmation($args); } - /** - * Hook before an status update to synchronize status with lengow - * - * @param array $args Arguments of hook - */ - public function hookUpdateOrderStatus($args) - { - $this->hookClass->hookUpdateOrderStatus($args); - } - /** * Order status update * Event This hook launches modules when the status of an order changes @@ -233,16 +187,6 @@ public function hookActionOrderStatusPostUpdate($args) $this->hookClass->hookPostUpdateOrderStatus($args); } - /** - * Hook after an status update to synchronize status with lengow - * - * @param array $args Arguments of hook - */ - public function hookPostUpdateOrderStatus($args) - { - $this->hookClass->hookPostUpdateOrderStatus($args); - } - /** * Hook for update order if isset tracking number * @@ -260,7 +204,7 @@ public function hookActionObjectUpdateAfter($args) * * @return mixed */ - public function hookAdminOrder($args) + public function hookDisplayAdminOrder($args) { return $this->hookClass->hookAdminOrder($args); }