diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 69c27a26..be45a483 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -45,7 +45,7 @@ jobs: ./libs/bin/phpcs --standard=ruleset.xml --severity=10 --report=checkstyle --report-file=chkphpcs.xml . - name: Archive code sniffing results - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: phpcs-xml-result path: chkphpcs.xml @@ -92,7 +92,7 @@ jobs: run: ./libs/bin/phpmd . xml codesize,naming,unusedcode,controversial,design --exclude libs,var,build,tests,.phan --reportfile pmdphpmd.xml --ignore-violations-on-exit - name: Archive mess detection results - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: phpmd-xml-result path: pmdphpmd.xml @@ -141,7 +141,7 @@ jobs: continue-on-error: true - name: Archive copy-paste detection results - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: phdpcpd-xml-result path: phdpcpd.xml @@ -193,7 +193,7 @@ jobs: run: ./libs/bin/phing -verbose -Dversion="${{steps.plugin_version.outputs.PLUGIN_VERSION}}" - name: Archive built package - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{steps.plugin_version.outputs.PLUGIN_VERSION}}-Nosto.-.Personalization.for.PrestaShop path: build/src \ No newline at end of file diff --git a/.github/workflows/ide.yml b/.github/workflows/ide.yml index ddbfd2d9..e2d6a0e1 100644 --- a/.github/workflows/ide.yml +++ b/.github/workflows/ide.yml @@ -50,7 +50,7 @@ jobs: - name: Archive inspection results if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: inspection-results path: output diff --git a/.github/workflows/phan.yml b/.github/workflows/phan.yml index e562ed8b..a223b90d 100644 --- a/.github/workflows/phan.yml +++ b/.github/workflows/phan.yml @@ -45,7 +45,7 @@ jobs: continue-on-error: true - name: Archive static analysis results - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: phan-analysis-results path: chkphan.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index 8793b64b..bcbc29f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning(http://semver.org/). +## 4.4.1 +- Fixes an issue that can cause division by zero errors when a product has zero total taxes associated with + ## 4.4.0 - Add compatibility with Prestashop 8.1 diff --git a/classes/models/NostoOrder.php b/classes/models/NostoOrder.php index f983d216..1668e721 100644 --- a/classes/models/NostoOrder.php +++ b/classes/models/NostoOrder.php @@ -245,7 +245,9 @@ protected static function findPurchasedItems(Order $order) //deduct the gift product among from product among $totalProductTaxIncl -= $totalGiftTaxIncl; - $discountPercentage = max(0, $totalDiscountsTaxIncl / $totalProductTaxIncl); + $discountPercentage = ($totalProductTaxIncl > 0) + ? max(0, $totalDiscountsTaxIncl / $totalProductTaxIncl) + : 0; /** @var NostoOrderPurchasedItem $purchasedItem */ foreach ($purchasedItems as $purchasedItem) { diff --git a/nostotagging.php b/nostotagging.php index c61771c5..1ee37127 100644 --- a/nostotagging.php +++ b/nostotagging.php @@ -55,7 +55,7 @@ class NostoTagging extends Module * * @var string */ - const PLUGIN_VERSION = '4.4.0'; + const PLUGIN_VERSION = '4.4.1'; /** * Internal name of the Nosto plug-in