diff --git a/.github/workflows/templates/e2e/Dockerfile b/.github/workflows/templates/e2e/Dockerfile index 2136acaf2c3..b9bf86b6530 100644 --- a/.github/workflows/templates/e2e/Dockerfile +++ b/.github/workflows/templates/e2e/Dockerfile @@ -2,6 +2,7 @@ FROM cypress/included:12.1.0 WORKDIR /e2e +RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* RUN npm i @cypress/webpack-preprocessor cypress-mollie cypress-testrail --save-dev CMD tail -f /dev/null diff --git a/Controller/ApplePay/ShippingMethods.php b/Controller/ApplePay/ShippingMethods.php index 6d4377f3dfe..39fb40cbb26 100644 --- a/Controller/ApplePay/ShippingMethods.php +++ b/Controller/ApplePay/ShippingMethods.php @@ -118,6 +118,7 @@ public function execute() 'totals' => array_map(function (AddressTotal $total) { return [ 'type' => 'final', + 'code' => $total->getCode(), 'label' => $total->getData('title'), 'amount' => number_format($total->getData('value'), 2, '.', ''), ]; diff --git a/view/frontend/web/js/view/product/apple-pay-button.js b/view/frontend/web/js/view/product/apple-pay-button.js index f965801e7e1..1ae2ac23045 100644 --- a/view/frontend/web/js/view/product/apple-pay-button.js +++ b/view/frontend/web/js/view/product/apple-pay-button.js @@ -223,7 +223,9 @@ define([ getLineItems: function () { let totals = [...this.quoteTotals]; - totals.pop(); + + // Delete the item that has code == grand_total + totals.splice(totals.findIndex(total => total.code === 'grand_total'), 1); return totals; }, @@ -231,7 +233,7 @@ define([ getTotal: function () { let totals = [...this.quoteTotals]; - var total = totals.pop(); + const total = totals.find(total => total.code === 'grand_total'); total.label = this.storeName;