Skip to content

Commit

Permalink
chore(main): release 3.5.7 (#28)
Browse files Browse the repository at this point in the history
* 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 <alexis.hermanns@lengow.com>
Co-authored-by: vagrant <vagrant@homestead>
  • Loading branch information
3 people authored Oct 14, 2024
1 parent 2047093 commit d57bc08
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 136 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <!-- x-release-please-version -->
- **Stable tag:** 3.5.7 <!-- x-release-please-version -->
- **License:** Apache-2.0
- **License URI:** http://www.apache.org/licenses/LICENSE-2.0

Expand Down
15 changes: 4 additions & 11 deletions classes/models/LengowCarrier.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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,
Expand Down
15 changes: 2 additions & 13 deletions classes/models/LengowCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
11 changes: 5 additions & 6 deletions classes/models/LengowConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}

Expand All @@ -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;
}
}

Expand Down
15 changes: 4 additions & 11 deletions classes/models/LengowMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 2 additions & 5 deletions classes/models/LengowOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions classes/models/LengowOrderError.php
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
16 changes: 2 additions & 14 deletions classes/models/LengowPaymentModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "prestashop/lengow",
"description": "Lengow",
"version": "3.5.6",
"version": "3.5.7",
"autoload": {
"psr-4": {
"Lengow\\": "src/"
Expand Down
20 changes: 10 additions & 10 deletions config/checkmd5.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
62 changes: 3 additions & 59 deletions lengow.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -132,14 +132,6 @@ public function hookDisplayBackOfficeHeader()
$this->hookClass->hookDisplayBackOfficeHeader();
}

/**
* Hook on Home page
*/
public function hookHome()
{
$this->hookClass->hookHome();
}

/**
* Hook on Home page
*/
Expand All @@ -148,14 +140,6 @@ public function hookDisplayHome()
$this->hookClass->hookHome();
}

/**
* Hook on Payment page
*/
public function hookPaymentTop()
{
$this->hookClass->hookPaymentTop();
}

/**
* Hook on Payment page
*/
Expand All @@ -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
*
Expand All @@ -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
*
Expand All @@ -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
Expand All @@ -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
*
Expand All @@ -260,7 +204,7 @@ public function hookActionObjectUpdateAfter($args)
*
* @return mixed
*/
public function hookAdminOrder($args)
public function hookDisplayAdminOrder($args)
{
return $this->hookClass->hookAdminOrder($args);
}
Expand Down

0 comments on commit d57bc08

Please sign in to comment.