From f4368a9e9b7393c04b2b079975712aba8ea72812 Mon Sep 17 00:00:00 2001 From: Rene <105488705+Buckaroo-Rene@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:44:59 +0200 Subject: [PATCH 01/13] Update logo in README.md (#1076) --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9caf34e6c..c42cfd001 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- +

# Buckaroo Magento 2 Payments Plugin @@ -104,3 +104,4 @@ If you want to contribute as well, then please follow our [Contribution Guidelin Please note:
This file has been prepared with the greatest possible care and is subject to language and/or spelling errors. + From 9ebe257f256193d979d266532c0b5d37082aca09 Mon Sep 17 00:00:00 2001 From: "v.carkaxhija" Date: Tue, 22 Oct 2024 13:32:45 +0200 Subject: [PATCH 02/13] update ideal fast checkout email sender --- Controller/Redirect/Process.php | 13 ++++++++----- Model/Push.php | 7 +++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Controller/Redirect/Process.php b/Controller/Redirect/Process.php index 570f78069..a78c6f241 100755 --- a/Controller/Redirect/Process.php +++ b/Controller/Redirect/Process.php @@ -330,13 +330,16 @@ private function redirectProcess() { || $paymentMethod->getConfigData('order_email', $store) === "1" ) ) { - if (!($this->hasPostData('add_initiated_by_magento', 1) && - $this->hasPostData('brq_primary_service', 'KlarnaKp') && - $this->hasPostData('add_service_action_from_magento', 'reserve') && - !empty($this->response['brq_service_klarnakp_reservationnumber']) + if (!( + ($this->hasPostData('add_initiated_by_magento', 1) && + $this->hasPostData('brq_primary_service', 'KlarnaKp') && + $this->hasPostData('add_service_action_from_magento', 'reserve') && + !empty($this->response['brq_service_klarnakp_reservationnumber'])) + || + $this->hasPostData('add_service_action_from_magento', 'payfastcheckout') )) { if ($statusCode == $this->helper->getStatusCode('BUCKAROO_MAGENTO2_STATUSCODE_SUCCESS')) { - $this->logger->addDebug(__METHOD__ . '|sendemail|'); + $this->logger->addDebug(__METHOD__ . '|sendemail| |1|'); $this->orderSender->send($this->order, true); } } diff --git a/Model/Push.php b/Model/Push.php index 6c3fff0bd..140777368 100644 --- a/Model/Push.php +++ b/Model/Push.php @@ -259,10 +259,6 @@ public function receivePush() try { $response = $this->pushProcess(); - if ($this->isFastCheckout()) { - $this->updateOrderAddressesIfFastCheckout(); - } - return $response; } catch (\Throwable $e) { $this->logging->addDebug(__METHOD__ . '|Exception|' . $e->getMessage()); @@ -597,6 +593,9 @@ private function pushProcess() ); } + if ($this->isFastCheckout()) { + $this->updateOrderAddressesIfFastCheckout(); + } if (!$this->isGroupTransactionInfo()) { $this->setTransactionKey(); From 698773e8e6dbe4b8b139730d166be7eafd05926a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vegim=20=C3=87arkaxhija?= Date: Tue, 15 Oct 2024 09:40:16 +0200 Subject: [PATCH 03/13] Merge pull request #1071 from buckaroo-it/BP-3761-Adjustment-in-the-main-module-to-resolve-an-issue-with-giftcards-for-the-additional-Hyv-Checkout-module Bp 3761 adjustment in the main module to resolve an issue with giftcards for the additional hyv checkout module --- Model/Total/Quote/BuckarooAlreadyPay.php | 96 +++++++++------ Model/Total/Quote/BuckarooRemainingAmount.php | 76 ++++++++++++ etc/sales.xml | 7 +- view/frontend/layout/checkout_index_index.xml | 21 ++-- .../js/view/checkout/summary/already-paid.js | 42 +++++++ .../js/view/checkout/summary/grand-total.js | 116 ------------------ .../view/checkout/summary/remaining-amount.js | 37 ++++++ .../checkout/summary/already-paid.html | 11 ++ .../checkout/summary/grand-total.html | 42 ------- .../checkout/summary/remaining-amount.html | 10 ++ 10 files changed, 251 insertions(+), 207 deletions(-) create mode 100644 Model/Total/Quote/BuckarooRemainingAmount.php create mode 100644 view/frontend/web/js/view/checkout/summary/already-paid.js delete mode 100644 view/frontend/web/js/view/checkout/summary/grand-total.js create mode 100644 view/frontend/web/js/view/checkout/summary/remaining-amount.js create mode 100644 view/frontend/web/template/checkout/summary/already-paid.html delete mode 100644 view/frontend/web/template/checkout/summary/grand-total.html create mode 100644 view/frontend/web/template/checkout/summary/remaining-amount.html diff --git a/Model/Total/Quote/BuckarooAlreadyPay.php b/Model/Total/Quote/BuckarooAlreadyPay.php index c7bb6ccf5..9efb45f73 100644 --- a/Model/Total/Quote/BuckarooAlreadyPay.php +++ b/Model/Total/Quote/BuckarooAlreadyPay.php @@ -1,5 +1,4 @@ setCode('buckaroo_already_paid'); $this->priceCurrency = $priceCurrency; @@ -50,53 +66,53 @@ public function __construct( /** * Add buckaroo fee information to address * - * @param \Magento\Quote\Model\Quote $quote - * @param \Magento\Quote\Model\Quote\Address\Total $total - * @return $this + * @param Quote $quote + * @param Total $total + * @return array + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function fetch(\Magento\Quote\Model\Quote $quote, \Magento\Quote\Model\Quote\Address\Total $total) + public function fetch(Quote $quote, Total $total) { $orderId = $quote->getReservedOrderId(); $customTitle = []; if ($orderId) { - $items = $this->groupTransaction->getGroupTransactionItemsNotRefunded($orderId); - - foreach ($items as $giftcard) { - $foundGiftcard = $this->giftcardCollection->getItemByColumnValue( - 'servicecode', - $giftcard['servicecode'] - ); - - if ($foundGiftcard !== null || $giftcard['servicecode'] === 'buckaroovoucher') { - - - if ($giftcard['servicecode'] === 'buckaroovoucher') { - $label = __('Voucher'); - } else { - $label = $foundGiftcard['label']; + try { + $items = $this->groupTransaction->getGroupTransactionItemsNotRefunded($orderId); + + foreach ($items as $giftcard) { + $foundGiftcard = $this->giftcardCollection->getItemByColumnValue( + 'servicecode', + $giftcard['servicecode'] + ); + + if ($foundGiftcard !== null || $giftcard['servicecode'] === 'buckaroovoucher') { + if ($giftcard['servicecode'] === 'buckaroovoucher') { + $label = __('Voucher'); + } else { + $label = $foundGiftcard['label']; + } + + $customTitle[] = [ + 'label' => __('Paid with') . ' ' . $label, + 'amount' => -$giftcard['amount'], + 'servicecode' => $giftcard['servicecode'], + 'serviceamount' => $giftcard['amount'], + 'transaction_id' => $giftcard['transaction_id'], + ]; } - - $customTitle[] = [ - 'label' => __('Paid with') . ' ' . $label, - 'amount' => -$giftcard['amount'], - 'servicecode' => $giftcard['servicecode'], - 'serviceamount' => $giftcard['amount'], - 'transaction_id' => $giftcard['transaction_id'], - ]; } + } catch (\Exception $e) { + // $this->logger->error($e->getMessage()); } } - /** - * @noinspection PhpUndefinedMethodInspection - */ - $totals = [ - 'code' => $this->getCode(), + return [ + 'code' => $this->getCode(), 'title' => $customTitle ? __(json_encode($customTitle)) : $this->getLabel(), - 'value' => $this->groupTransaction->getAlreadyPaid($orderId), + 'value' => -$this->groupTransaction->getAlreadyPaid($orderId), ]; - return $totals; } /** diff --git a/Model/Total/Quote/BuckarooRemainingAmount.php b/Model/Total/Quote/BuckarooRemainingAmount.php new file mode 100644 index 000000000..bc6eff67a --- /dev/null +++ b/Model/Total/Quote/BuckarooRemainingAmount.php @@ -0,0 +1,76 @@ +setCode('remaining_amount'); + $this->groupTransaction = $groupTransaction; + } + + /** + * Fetch remaining amount for display in the frontend + * + * @param Quote $quote + * @param Total $total + * @return array + */ + public function fetch(Quote $quote, Total $total) + { + // Fetch the already paid amount + $alreadyPaid = $this->groupTransaction->getAlreadyPaid($quote->getReservedOrderId()); + $grandTotal = $quote->getGrandTotal(); + $remainingAmount = max(0, $grandTotal - $alreadyPaid); + + return [ + 'code' => $this->getCode(), + 'title' => __('Remaining Amount'), + 'value' => $remainingAmount + ]; + } + + /** + * Get Buckaroo label + * + * @return \Magento\Framework\Phrase + */ + public function getLabel() + { + return __('Fee'); + } +} diff --git a/etc/sales.xml b/etc/sales.xml index a884141fb..3171d1aaf 100644 --- a/etc/sales.xml +++ b/etc/sales.xml @@ -31,11 +31,16 @@ + + + + +
- +
diff --git a/view/frontend/layout/checkout_index_index.xml b/view/frontend/layout/checkout_index_index.xml index 2fd41041a..cb37f60ee 100644 --- a/view/frontend/layout/checkout_index_index.xml +++ b/view/frontend/layout/checkout_index_index.xml @@ -51,14 +51,19 @@
- - Buckaroo_Magento2/js/view/checkout/summary/grand-total - - Order Total Excl. Tax - Order Total Incl. Tax - You will be charged for - Order Total - + + + Buckaroo_Magento2/js/view/checkout/summary/remaining-amount + 250 + Remaining Amount + false + + + + Buckaroo_Magento2/js/view/checkout/summary/already-paid + 300 + Already Paid + false diff --git a/view/frontend/web/js/view/checkout/summary/already-paid.js b/view/frontend/web/js/view/checkout/summary/already-paid.js new file mode 100644 index 000000000..189a9e139 --- /dev/null +++ b/view/frontend/web/js/view/checkout/summary/already-paid.js @@ -0,0 +1,42 @@ +define([ + 'Magento_Checkout/js/view/summary/abstract-total', + 'Magento_Checkout/js/model/quote', + 'Magento_Catalog/js/price-utils', + 'Magento_Checkout/js/model/totals' +], function (Component, quote, priceUtils, totals) { + 'use strict'; + + return Component.extend({ + defaults: { + template: 'Buckaroo_Magento2/checkout/summary/already-paid' + }, + isDisplayed: function () { + return this.getAlreadyPaidTotal() > 0; + }, + getValue: function () { + var alreadyPaid = this.getAlreadyPaidTotal(); + return this.getFormattedPrice(alreadyPaid); + }, + getAlreadyPaidTotal: function () { + var buckarooFeeSegment = totals.getSegment('buckaroo_already_paid'); + try { + if (buckarooFeeSegment.title) { + var items = JSON.parse(buckarooFeeSegment.title); + var total = 0; + if ((typeof items === 'object') && (items.length > 0)) { + for (var i = 0; i < items.length; i++) { + total = parseFloat(total) + parseFloat(items[i].serviceamount); + } + return parseFloat(total).toFixed(2); + } + } + } catch (e) { + } + + return parseFloat(buckarooFeeSegment.value).toFixed(2); + }, + getFormattedPrice: function (price) { + return priceUtils.formatPrice(price, quote.getPriceFormat()); + } + }); +}); diff --git a/view/frontend/web/js/view/checkout/summary/grand-total.js b/view/frontend/web/js/view/checkout/summary/grand-total.js deleted file mode 100644 index 3c1c89431..000000000 --- a/view/frontend/web/js/view/checkout/summary/grand-total.js +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -/** - * @api - */ - -define([ - 'Magento_Checkout/js/view/summary/abstract-total', - 'Magento_Checkout/js/model/quote', - 'Magento_Catalog/js/price-utils', - 'Magento_Checkout/js/model/totals' -], function (Component, quote, priceUtils, totals) { - 'use strict'; - - return Component.extend({ - defaults: { - isFullTaxSummaryDisplayed: window.checkoutConfig.isFullTaxSummaryDisplayed || false, - template: 'Buckaroo_Magento2/checkout/summary/grand-total' - }, - totals: quote.getTotals(), - isTaxDisplayedInGrandTotal: window.checkoutConfig.includeTaxInGrandTotal || false, - - /** - * @return {*} - */ - isDisplayed: function () { - return this.isFullMode(); - }, - - /** - * @return {*|String} - */ - getValue: function () { - var price = 0; - - if (this.totals()) { - price = totals.getSegment('grand_total').value; - - if(!isNaN(parseFloat(this.getAlreadyPayTotal()))){ - price = parseFloat(price) - parseFloat(this.getAlreadyPayTotal()); - } - } - - return this.getFormattedPrice(price); - }, - - /** - * @return {*|String} - */ - getBaseValue: function () { - var price = 0; - - if (this.totals()) { - price = this.totals()['base_grand_total']; - } - - return priceUtils.formatPriceLocale(price, quote.getBasePriceFormat()); - }, - - /** - * @return {*} - */ - getGrandTotalExclTax: function () { - var total = this.totals(), - amount; - - if (!total) { - return 0; - } - - amount = total['grand_total'] - total['tax_amount']; - - if (amount < 0) { - amount = 0; - } - - return this.getFormattedPrice(amount); - }, - - /** - * @return {Boolean} - */ - isBaseGrandTotalDisplayNeeded: function () { - var total = this.totals(); - - if (!total) { - return false; - } - - return total['base_currency_code'] != total['quote_currency_code']; //eslint-disable-line eqeqeq - }, - - getAlreadyPayTotal : function () { - var buckarooFeeSegment = totals.getSegment('buckaroo_already_paid'); - try { - if (buckarooFeeSegment.title) { - var items = JSON.parse(buckarooFeeSegment.title); - var total = 0; - if ((typeof items === 'object') && (items.length > 0)) { - for (var i = 0; i < items.length; i++) { - total = parseFloat(total) + parseFloat(items[i].serviceamount); - } - return parseFloat(total).toFixed(2); - } - } - } catch (e) { - // console.log(e); - } - - return parseFloat(buckarooFeeSegment.value).toFixed(2); - } - }); -}); diff --git a/view/frontend/web/js/view/checkout/summary/remaining-amount.js b/view/frontend/web/js/view/checkout/summary/remaining-amount.js new file mode 100644 index 000000000..9a12ae4f2 --- /dev/null +++ b/view/frontend/web/js/view/checkout/summary/remaining-amount.js @@ -0,0 +1,37 @@ +define([ + 'Magento_Checkout/js/view/summary/abstract-total', + 'Magento_Checkout/js/model/quote', + 'Magento_Catalog/js/price-utils', + 'Magento_Checkout/js/model/totals' +], function (Component, quote, priceUtils, totals) { + 'use strict'; + + return Component.extend({ + defaults: { + template: 'Buckaroo_Magento2/checkout/summary/remaining-amount' + }, + isDisplayed: function () { + return this.getAlreadyPaidTotal() < 0; + }, + getValue: function () { + var remainingAmount = 0; + if (totals.getSegment('remaining_amount')) { + remainingAmount = totals.getSegment('remaining_amount').value; + } + return this.getFormattedPrice(remainingAmount); + }, + getAlreadyPaidTotal: function () { + var remainingAmount = 0; + if (totals.getSegment('buckaroo_already_paid')) { + remainingAmount = totals.getSegment('buckaroo_already_paid').value; + } + return remainingAmount; + }, + getTitle: function () { + return this.title; + }, + getFormattedPrice: function (price) { + return priceUtils.formatPrice(price, quote.getPriceFormat()); + } + }); +}); diff --git a/view/frontend/web/template/checkout/summary/already-paid.html b/view/frontend/web/template/checkout/summary/already-paid.html new file mode 100644 index 000000000..41d367b5b --- /dev/null +++ b/view/frontend/web/template/checkout/summary/already-paid.html @@ -0,0 +1,11 @@ + + + + +

+ + +

+ + + diff --git a/view/frontend/web/template/checkout/summary/grand-total.html b/view/frontend/web/template/checkout/summary/grand-total.html deleted file mode 100644 index 5a324f922..000000000 --- a/view/frontend/web/template/checkout/summary/grand-total.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/view/frontend/web/template/checkout/summary/remaining-amount.html b/view/frontend/web/template/checkout/summary/remaining-amount.html new file mode 100644 index 000000000..bcba4c746 --- /dev/null +++ b/view/frontend/web/template/checkout/summary/remaining-amount.html @@ -0,0 +1,10 @@ + + + + + + + + + + From 867a4c481d766aed6ed5b192d6ba9d7846e6b855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vegim=20=C3=87arkaxhija?= Date: Mon, 21 Oct 2024 16:01:09 +0200 Subject: [PATCH 04/13] Merge pull request #1075 from buckaroo-it/BP-3843-v1.50-breaks-Magento-API-schema BP-3843-v1.50-breaks-Magento-API-schema --- Api/Data/QuoteCreateResponseInterface.php | 4 +--- Api/IdealQuoteCreateInterface.php | 5 +---- Api/PayWithGiftcardInterface.php | 5 ++--- Api/PaypalExpressQuoteCreateInterface.php | 3 +-- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/Api/Data/QuoteCreateResponseInterface.php b/Api/Data/QuoteCreateResponseInterface.php index c8e06f765..f8bc6cf6d 100644 --- a/Api/Data/QuoteCreateResponseInterface.php +++ b/Api/Data/QuoteCreateResponseInterface.php @@ -19,8 +19,6 @@ */ namespace Buckaroo\Magento2\Api\Data; -use Buckaroo\Magento2\Api\Data\BreakdownItemInterface; - interface QuoteCreateResponseInterface extends BreakdownItemInterface { /** @@ -36,4 +34,4 @@ public function getBreakdown(); * @return string */ public function getCartId(); -} \ No newline at end of file +} diff --git a/Api/IdealQuoteCreateInterface.php b/Api/IdealQuoteCreateInterface.php index e9aa88e57..3bead625c 100644 --- a/Api/IdealQuoteCreateInterface.php +++ b/Api/IdealQuoteCreateInterface.php @@ -21,9 +21,6 @@ namespace Buckaroo\Magento2\Api; -use Buckaroo\Magento2\Api\Data\QuoteCreateResponseInterface; -use Buckaroo\Magento2\Api\Data\Ideal\ShippingAddressRequestInterface; - interface IdealQuoteCreateInterface { /** @@ -31,7 +28,7 @@ interface IdealQuoteCreateInterface * * @param string $page * @param string|null $order_data - * @return QuoteCreateResponseInterface + * @return \Buckaroo\Magento2\Api\Data\QuoteCreateResponseInterface */ public function execute( string $page, diff --git a/Api/PayWithGiftcardInterface.php b/Api/PayWithGiftcardInterface.php index e6de57d84..cc3f9d729 100644 --- a/Api/PayWithGiftcardInterface.php +++ b/Api/PayWithGiftcardInterface.php @@ -23,15 +23,14 @@ use Buckaroo\Magento2\Api\Data\Giftcard\PayRequestInterface; -interface PayWithGiftcardInterface +interface PayWithGiftcardInterface { /** * Rest method for paying with giftcards * * @param string $cartId * @param string $giftcardId - * @param \Buckaroo\Magento2\Api\Data\Giftcard\PayRequestInterface $requestBody - * + * @param \Buckaroo\Magento2\Api\Data\Giftcard\PayRequestInterface $payment * @return \Buckaroo\Magento2\Api\Data\Giftcard\PayResponseInterface */ public function pay(string $cartId, string $giftcardId, PayRequestInterface $payment); diff --git a/Api/PaypalExpressQuoteCreateInterface.php b/Api/PaypalExpressQuoteCreateInterface.php index 74947cd96..053f376e0 100644 --- a/Api/PaypalExpressQuoteCreateInterface.php +++ b/Api/PaypalExpressQuoteCreateInterface.php @@ -22,7 +22,6 @@ namespace Buckaroo\Magento2\Api; use Buckaroo\Magento2\Api\Data\PaypalExpress\ShippingAddressRequestInterface; -use Buckaroo\Magento2\Api\Data\QuoteCreateResponseInterface; interface PaypalExpressQuoteCreateInterface { @@ -32,7 +31,7 @@ interface PaypalExpressQuoteCreateInterface * @param \Buckaroo\Magento2\Api\Data\PaypalExpress\ShippingAddressRequestInterface $shipping_address * @param string $page * @param string|null $order_data - * @return QuoteCreateResponseInterface + * @return \Buckaroo\Magento2\Api\Data\QuoteCreateResponseInterface */ public function execute( ShippingAddressRequestInterface $shipping_address, From 1e69ef1ebb996f73037103c5a071300ccafd5c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vegim=20=C3=87arkaxhija?= Date: Wed, 16 Oct 2024 15:54:11 +0200 Subject: [PATCH 05/13] Merge pull request #1073 from buckaroo-it/BP-3838-Refactor-Fast-Checkout-Button-Implementation-for-iDEAL-using-Magento-UI-Components BP-3838-Refactor-Fast-Checkout-Button-Implementation-for-iDEAL-using-Magento-UI-Components --- view/frontend/layout/catalog_product_view.xml | 5 +- view/frontend/layout/checkout_cart_index.xml | 3 + .../product/view/ideal-fast-checkout.phtml | 83 ++++++++++--------- .../checkout/cart/ideal-fast-checkout.phtml | 83 ++++++++++--------- view/frontend/web/css/ideal-fast-checkout.css | 17 ++++ .../view/checkout/ideal-fast-checkout/pay.js | 44 ++++++++-- 6 files changed, 149 insertions(+), 86 deletions(-) create mode 100644 view/frontend/web/css/ideal-fast-checkout.css diff --git a/view/frontend/layout/catalog_product_view.xml b/view/frontend/layout/catalog_product_view.xml index 96ba3015a..46239ee9d 100644 --- a/view/frontend/layout/catalog_product_view.xml +++ b/view/frontend/layout/catalog_product_view.xml @@ -18,6 +18,9 @@ * @license https://tldrlegal.com/license/mit-license --> + + + - \ No newline at end of file + diff --git a/view/frontend/layout/checkout_cart_index.xml b/view/frontend/layout/checkout_cart_index.xml index 17a7d2bdb..abf009c79 100644 --- a/view/frontend/layout/checkout_cart_index.xml +++ b/view/frontend/layout/checkout_cart_index.xml @@ -6,6 +6,9 @@ */ --> + + + canShowProductButton()): ?> - - +if ($block->canShowProductButton()): ?> - + diff --git a/view/frontend/templates/checkout/cart/ideal-fast-checkout.phtml b/view/frontend/templates/checkout/cart/ideal-fast-checkout.phtml index ba779e13c..4eb96518f 100644 --- a/view/frontend/templates/checkout/cart/ideal-fast-checkout.phtml +++ b/view/frontend/templates/checkout/cart/ideal-fast-checkout.phtml @@ -1,45 +1,52 @@ canShowCartButton()): ?> - - - - + diff --git a/view/frontend/web/css/ideal-fast-checkout.css b/view/frontend/web/css/ideal-fast-checkout.css new file mode 100644 index 000000000..e107f91ac --- /dev/null +++ b/view/frontend/web/css/ideal-fast-checkout.css @@ -0,0 +1,17 @@ +#fast-checkout-ideal-btn { + height: 45px; + padding: 0; + border: none; + background: none; + display: flex; + align-items: center; + justify-content: center; + margin: 20px 0; +} + +#fast-checkout-ideal-btn img { + max-height: 100%; + max-width: 100%; + display: block; + margin: auto; +} diff --git a/view/frontend/web/js/view/checkout/ideal-fast-checkout/pay.js b/view/frontend/web/js/view/checkout/ideal-fast-checkout/pay.js index 5235ef3d0..f03403f90 100644 --- a/view/frontend/web/js/view/checkout/ideal-fast-checkout/pay.js +++ b/view/frontend/web/js/view/checkout/ideal-fast-checkout/pay.js @@ -1,23 +1,49 @@ define([ - 'jquery', + 'uiComponent', 'mage/url', + 'jquery', 'Magento_Customer/js/customer-data', 'mage/translate', 'mage/storage' -], function ($, urlBuilder, customerData, $t, storage) { +], function (Component, urlBuilder, $, customerData, $t, storage) { 'use strict'; - return { - createQuoteAndPlaceOrder: function (productData) { - this.showLoader(); + return Component.extend({ + page: null, + paymentData: null, + + initialize: function (config) { + this._super(); - this.page = productData.page; - productData.order_data = this.getOrderData(); + this.page = config.page; + this.paymentData = config.paymentData; var customerDataObject = customerData.get('customer'); customerDataObject.subscribe(function (updatedCustomer) { }.bind(this)); + + $(document).on('click', '#fast-checkout-ideal-btn', function() { + this.onCheckout(); + }.bind(this)); + }, + + onCheckout: function () { + var qty = $(".qty").val(); + + var productData = { + qty: qty, + page: this.page, + paymentData: this.paymentData, + order_data: this.getOrderData() + }; + + this.createQuoteAndPlaceOrder(productData); + }, + + createQuoteAndPlaceOrder: function (productData) { + this.showLoader(); + this.processOrderFlow(productData) .then(this.onQuoteCreateSuccess.bind(this, productData)) .catch(this.onQuoteCreateFail.bind(this)); @@ -33,7 +59,7 @@ define([ getOrderData: function () { let form = $("#product_addtocart_form"); - return this.page === 'product' ? form.serialize() : null; + return this.page === "product" ? form.serialize() : null; }, onQuoteCreateSuccess: function (productData, quoteResponse) { @@ -123,5 +149,5 @@ define([ hideLoader: function () { $('body').loader('hide'); } - }; + }); }); From 67033db0a9c3f12f3ee7e1e79522f01c5c5a9e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vegim=20=C3=87arkaxhija?= Date: Wed, 23 Oct 2024 11:31:42 +0200 Subject: [PATCH 06/13] Merge pull request #1078 from buckaroo-it/BP-3697-iDEAL-fast-checkout-issue-with-Shipping-costs-that-are-not-showed-as-shipping-costs fix ideal fastcheckout shippingcost --- Model/Method/Ideal.php | 23 +++++++++++++++++++ .../view/checkout/ideal-fast-checkout/pay.js | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Model/Method/Ideal.php b/Model/Method/Ideal.php index 2402a8f30..bc10eb8d3 100644 --- a/Model/Method/Ideal.php +++ b/Model/Method/Ideal.php @@ -53,6 +53,14 @@ public function assignData(\Magento\Framework\DataObject $data) $this->getInfoInstance()->setAdditionalInformation('issuer', $data['additional_data']['issuer']); } + $payment = $this->getInfoInstance(); + $quote = $payment->getQuote(); + + if ($quote) { + $shippingCost = $quote->getShippingAddress()->getShippingAmount(); + $this->getInfoInstance()->setAdditionalInformation('shippingCost', $shippingCost); + } + return $this; } @@ -67,6 +75,7 @@ public function getOrderTransactionBuilder($payment) 'Name' => 'ideal', 'Action' => $this->getPayRemainder($payment, $transactionBuilder,'PayFastCheckout'), 'Version' => 2, + 'RequestParameter' => $this->getIdealFastCheckoutOrderRequestParameters($payment), ]; /** @@ -110,6 +119,20 @@ private function getOrderRequestParameters($payment): array return $parameters; } + private function getIdealFastCheckoutOrderRequestParameters($payment): array + { + $parameters = []; + + if ($this->isFastCheckout($payment) && $payment->getAdditionalInformation('shippingCost')) { + $parameters = [[ + '_' => $payment->getAdditionalInformation('shippingCost'), + 'Name' => 'shippingCost', + ]]; + } + + return $parameters; + } + protected function getRefundTransactionBuilderVersion() { return null; diff --git a/view/frontend/web/js/view/checkout/ideal-fast-checkout/pay.js b/view/frontend/web/js/view/checkout/ideal-fast-checkout/pay.js index f03403f90..272012621 100644 --- a/view/frontend/web/js/view/checkout/ideal-fast-checkout/pay.js +++ b/view/frontend/web/js/view/checkout/ideal-fast-checkout/pay.js @@ -29,7 +29,7 @@ define([ }, onCheckout: function () { - var qty = $(".qty").val(); + var qty = $("#qty").val(); var productData = { qty: qty, From 8935966fd502193c8a838e93172f5c444e73888e Mon Sep 17 00:00:00 2001 From: Sander <37146557+SandervdHulst@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:32:42 +0200 Subject: [PATCH 07/13] Merge pull request #1074 from buckaroo-it/BP-3663-Buckaroo-Payment-Fee-Prices-does-not-make-a-difference-(Tax-settings) BP-3663 Buckaroo payment fee prices does not make a difference (tax settings) --- Model/Total/Quote/BuckarooFee.php | 37 +++++++++++++++++++-------- Model/Total/Quote/BuckarooFeeHyva.php | 35 ++++++++++++++++++------- 2 files changed, 53 insertions(+), 19 deletions(-) diff --git a/Model/Total/Quote/BuckarooFee.php b/Model/Total/Quote/BuckarooFee.php index 765cf0f4e..294fb4fce 100644 --- a/Model/Total/Quote/BuckarooFee.php +++ b/Model/Total/Quote/BuckarooFee.php @@ -231,25 +231,35 @@ public function getBaseFee( $configProvider = $this->configProviderMethodFactory->get($buckarooPaymentMethodCode); $basePaymentFee = trim($configProvider->getPaymentFee($quote->getStore())); + $inclTax = $this->configProviderBuckarooFee->getPaymentFeeTax() == + Calculation::DISPLAY_TYPE_INCLUDING_TAX; + + $shippingAddress = $quote->getShippingAddress(); + $billingAddress = $quote->getBillingAddress(); + $customerTaxClassId = $quote->getCustomerTaxClassId(); + $storeId = $quote->getStoreId(); + $taxClassId = $this->configProviderBuckarooFee->getTaxClass(); + + $request = $this->taxCalculation->getRateRequest( + $shippingAddress, + $billingAddress, + $customerTaxClassId, + $storeId + ); + $request->setProductClassId($taxClassId); + $percent = $this->taxCalculation->getRate($request); if (is_numeric($basePaymentFee)) { if (in_array($buckarooPaymentMethodCode, ['billink','afterpay20','afterpay','paypal'])) { - - $inclTax = $this->configProviderBuckarooFee->getPaymentFeeTax() == - Calculation::DISPLAY_TYPE_INCLUDING_TAX; - if ($inclTax) { - $request = $this->taxCalculation->getRateRequest(null, null, null, $quote->getStore()); - $taxClassId = $this->configProviderBuckarooFee->getTaxClass($quote->getStore()); - $percent = $this->taxCalculation->getRate($request->setProductClassId($taxClassId)); if ($percent > 0) { return $basePaymentFee / (1 + ($percent / 100)); } } return $basePaymentFee; } else { - if ($inclTax) { - return $basePaymentFee; + if ($inclTax){ + return $basePaymentFee / (1 + ($percent / 100)); } /** * Payment fee is a number @@ -286,8 +296,15 @@ public function getBaseFee( $total = $address->getBaseSubtotalTotalInclTax(); break; } + $percentageFee = ($percentage / 100) * $total; - $basePaymentFee = ($percentage / 100) * $total; + if($inclTax){ + if($percent > 0){ + return $percentageFee / (1 + ($percent / 100)); + } + } else{ + return $percentageFee; + } return $basePaymentFee; } diff --git a/Model/Total/Quote/BuckarooFeeHyva.php b/Model/Total/Quote/BuckarooFeeHyva.php index 5f500bdf5..9e04a3a2d 100644 --- a/Model/Total/Quote/BuckarooFeeHyva.php +++ b/Model/Total/Quote/BuckarooFeeHyva.php @@ -217,17 +217,27 @@ public function getBaseFee( $configProvider = $this->configProviderMethodFactory->get($buckarooPaymentMethodCode); $basePaymentFee = trim($configProvider->getPaymentFee($quote->getStore())); + $inclTax = $this->configProviderBuckarooFee->getPaymentFeeTax() == + Calculation::DISPLAY_TYPE_INCLUDING_TAX; + + $shippingAddress = $quote->getShippingAddress(); + $billingAddress = $quote->getBillingAddress(); + $customerTaxClassId = $quote->getCustomerTaxClassId(); + $storeId = $quote->getStoreId(); + $taxClassId = $this->configProviderBuckarooFee->getTaxClass(); + + $request = $this->taxCalculation->getRateRequest( + $shippingAddress, + $billingAddress, + $customerTaxClassId, + $storeId + ); + $request->setProductClassId($taxClassId); + $percent = $this->taxCalculation->getRate($request); if (is_numeric($basePaymentFee)) { if (in_array($buckarooPaymentMethodCode, ['billink','afterpay20','afterpay','paypal'])) { - - $inclTax = $this->configProviderBuckarooFee->getPaymentFeeTax() == - Calculation::DISPLAY_TYPE_INCLUDING_TAX; - if ($inclTax) { - $request = $this->taxCalculation->getRateRequest(null, null, null, $quote->getStore()); - $taxClassId = $this->configProviderBuckarooFee->getTaxClass($quote->getStore()); - $percent = $this->taxCalculation->getRate($request->setProductClassId($taxClassId)); if ($percent > 0) { return $basePaymentFee / (1 + ($percent / 100)); } @@ -235,7 +245,7 @@ public function getBaseFee( return $basePaymentFee; } else { if ($inclTax) { - return $basePaymentFee; + return $basePaymentFee / (1 + ($percent / 100)); } /** * Payment fee is a number @@ -272,8 +282,15 @@ public function getBaseFee( $total = $address->getBaseSubtotalTotalInclTax(); break; } + $percentageFee = ($percentage / 100) * $total; - $basePaymentFee = ($percentage / 100) * $total; + if($inclTax){ + if($percent > 0){ + return $percentageFee / (1 + ($percent / 100)); + } + } else{ + return $percentageFee; + } return $basePaymentFee; } From 60566e35b757f344f3a95c977a816f083206fa9c Mon Sep 17 00:00:00 2001 From: "v.carkaxhija" Date: Wed, 23 Oct 2024 16:11:45 +0200 Subject: [PATCH 08/13] change version number --- Service/Software/Data.php | 2 +- composer.json | 2 +- etc/module.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Service/Software/Data.php b/Service/Software/Data.php index b8dada996..a2923ff13 100644 --- a/Service/Software/Data.php +++ b/Service/Software/Data.php @@ -36,7 +36,7 @@ class Data const MODULE_CODE = 'Buckaroo_Magento2'; /** Version of Module */ - const BUCKAROO_VERSION = '1.50.1'; + const BUCKAROO_VERSION = '1.50.2'; /** @var ProductMetadataInterface */ private $productMetadata; diff --git a/composer.json b/composer.json index fa766e059..dfb034b7f 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "docs": "https://docs.buckaroo.io/" }, "homepage": "https://www.buckaroo.nl", - "version" : "v1.50.1", + "version" : "v1.50.2", "minimum-stability": "stable", "autoload": { "files": [ diff --git a/etc/module.xml b/etc/module.xml index 9199b2144..fcd4535b7 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -20,7 +20,7 @@ */ --> - + From 5acc459e4f95448f945e628aa693de79afdcb6a3 Mon Sep 17 00:00:00 2001 From: Sander Date: Wed, 23 Oct 2024 16:24:06 +0200 Subject: [PATCH 09/13] BP-3847-Tax percentage not send in request for Riverty/Klarna/Billink --- Helper/Data.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Helper/Data.php b/Helper/Data.php index d80e6b8c0..a620f52c0 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -384,7 +384,7 @@ public function areEqualAmounts($amount1, $amount2) if ($amount2 == 0) { return $amount1 == $amount2; } else { - return abs((floatval($amount1) - floatval($amount2)) / floatval($amount2)) < 0.00001; + return abs((floatval($amount1) - floatval($amount2)) / floatval($amount2)) <= 0.01; } } From 7fee5009999e604ef0578be85fd69c0a073c08a1 Mon Sep 17 00:00:00 2001 From: Sander Date: Wed, 23 Oct 2024 13:15:28 +0200 Subject: [PATCH 10/13] BP-3847-Tax percentage not send in request for Riverty/Klarna/Billink --- Model/Method/AbstractMethod.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Model/Method/AbstractMethod.php b/Model/Method/AbstractMethod.php index 95b207980..5427c5bca 100644 --- a/Model/Method/AbstractMethod.php +++ b/Model/Method/AbstractMethod.php @@ -2124,9 +2124,20 @@ public function getArticleArrayLine( protected function getTaxCategory($order) { - $request = $this->taxCalculation->getRateRequest(null, null, null, $order->getStore()); - $taxClassId = $this->configProviderBuckarooFee->getTaxClass($order->getStore()); - $percent = $this->taxCalculation->getRate($request->setProductClassId($taxClassId)); + $shippingAddress = $order->getShippingAddress(); + $billingAddress = $order->getBillingAddress(); + $customerTaxClassId = $order->getCustomerTaxClassId(); + $storeId = $order->getStoreId(); + $taxClassId = $this->configProviderBuckarooFee->getTaxClass(); + + $request = $this->taxCalculation->getRateRequest( + $shippingAddress, + $billingAddress, + $customerTaxClassId, + $storeId + ); + $request->setProductClassId($taxClassId); + $percent = $this->taxCalculation->getRate($request); return $percent; } @@ -2725,7 +2736,7 @@ public function checkTotalGrossAmount($requestData, $payment) } //Add diff line - if (!$this->helper->areEqualAmounts($order->getGrandTotal(), $itemsTotalAmount) && !$this->payRemainder) { + if (abs($order->getGrandTotal() - $itemsTotalAmount) > 0.01) { $diff = $order->getGrandTotal() - $itemsTotalAmount; $diffLine = $this->getDiffLine($count, $diff); $requestData = array_merge($requestData, $diffLine); From 6f53077b95dbb55d0c82df0d49f5c4d1fc5d9058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vegim=20=C3=87arkaxhija?= Date: Thu, 24 Oct 2024 09:03:27 +0200 Subject: [PATCH 11/13] Merge pull request #1080 from buckaroo-it/BP-3856-Add-CSP-allow-list-for-Apple-Pay-Payconiq BP-3856-Add-CSP-allow-list-for-Apple-Pay-Payconiq --- etc/csp_whitelist.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/csp_whitelist.xml b/etc/csp_whitelist.xml index 35c36e996..8aadc2928 100644 --- a/etc/csp_whitelist.xml +++ b/etc/csp_whitelist.xml @@ -18,15 +18,18 @@ list.xsd"> + https://portal.payconiq.com https://static.buckaroo.nl + wss://websocketservice-externalapi.prod.buckaroo.io https://static.buckaroo.nl wss://websockets.buckaroo.io/ https://checkout.buckaroo.nl https://testcheckout.buckaroo.nl + https://applepay.buckaroo.io From 385f7d16924d37baec581e63934207cf2cf59844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vegim=20=C3=87arkaxhija?= Date: Thu, 24 Oct 2024 16:30:14 +0200 Subject: [PATCH 12/13] Merge pull request #1082 from buckaroo-it/BP-3859-Check-settings-for-IdealFastCheckout-PayPalExpress-ApplePay-when-to-show-buttons BP-3859-Check-settings-for-IdealFastCheckout-PayPalExpress-ApplePay-when-to-show-buttons --- Block/Catalog/Product/View/Applepay.php | 42 +++++-------------- .../Product/View/IdealFastCheckout.php | 42 +++---------------- Block/Catalog/Product/View/PaypalExpress.php | 24 +++-------- Model/ConfigProvider/Method/Applepay.php | 4 ++ Model/ConfigProvider/Method/Ideal.php | 5 +++ Model/ConfigProvider/Method/Paypal.php | 6 ++- .../catalog/product/view/applepay.phtml | 4 +- .../product/view/ideal-fast-checkout.phtml | 2 +- .../catalog/product/view/paypal-express.phtml | 4 +- .../templates/checkout/cart/applepay.phtml | 2 +- .../checkout/cart/ideal-fast-checkout.phtml | 2 +- .../checkout/cart/paypal-express.phtml | 2 +- 12 files changed, 42 insertions(+), 97 deletions(-) diff --git a/Block/Catalog/Product/View/Applepay.php b/Block/Catalog/Product/View/Applepay.php index b56485b71..9870b9d79 100644 --- a/Block/Catalog/Product/View/Applepay.php +++ b/Block/Catalog/Product/View/Applepay.php @@ -60,41 +60,23 @@ public function __construct( /** * @return bool */ - public function canShowButton() + public function canShowButton($page) { - $result = false; - - if ($this->cart->getSummaryQty() - && - ($this->applepayConfigProvider->getActive() != 0) - && - ($this->applepayConfigProvider->getAvailableButtons()) - && - (in_array('Cart', $this->applepayConfigProvider->getAvailableButtons())) - ) { - $result = true; - } - - return $result; + return $this->cart->getSummaryQty() && + $this->isModuleActive() && + in_array($page, $this->applepayConfigProvider->getAvailableButtons()) && + $this->applepayConfigProvider->isApplePayEnabled($this->_storeManager->getStore()); } /** + * Check if Buckaroo module is active + * * @return bool */ - public function canShowProductButton() + public function isModuleActive() { - $result = false; - - if (($this->applepayConfigProvider->getActive() != 0) - && - ($this->applepayConfigProvider->getAvailableButtons()) - && - (in_array('Product', $this->applepayConfigProvider->getAvailableButtons())) - ) { - $result = true; - } - - return $result; + $status = $this->applepayConfigProvider->getActive(); + return $status == 1 || $status == 2; } /** @@ -102,10 +84,6 @@ public function canShowProductButton() */ public function getCheckoutConfig() { - if (!$this->canShowButton()) { - return null; - } - return json_encode($this->compositeConfigProvider->getConfig(), JSON_HEX_TAG); } diff --git a/Block/Catalog/Product/View/IdealFastCheckout.php b/Block/Catalog/Product/View/IdealFastCheckout.php index b2e87188b..5647009e3 100644 --- a/Block/Catalog/Product/View/IdealFastCheckout.php +++ b/Block/Catalog/Product/View/IdealFastCheckout.php @@ -69,31 +69,12 @@ public function __construct( * * @return bool */ - public function canShowProductButton() + public function canShowButton($page) { - if ($this->isModuleActive() && $this->isButtonEnabled()){ - return $this->idealConfig->canShowButtonForPage( - 'Product', - $this->_storeManager->getStore() - ); - } - return false; - } - - /** - * Determine if the cart button can be shown - * - * @return bool - */ - public function canShowCartButton() - { - if ($this->isModuleActive() && $this->isButtonEnabled()){ - return $this->idealConfig->canShowButtonForPage( - 'Cart', - $this->_storeManager->getStore() - ); - } - return false; + return ($this->isModuleActive() && + $this->idealConfig->isFastCheckoutEnabled($this->_storeManager->getStore()) && + $this->idealConfig->canShowButtonForPage($page, $this->_storeManager->getStore()) && + $this->idealConfig->isIDealEnabled($this->_storeManager->getStore())); } /** @@ -107,19 +88,6 @@ public function isModuleActive() return $status == 1 || $status == 2; } - /** - * Check if ideal fast checkout button is enabled - * - * @return mixed - */ - public function isButtonEnabled() - { - return $this->idealConfig->isFastCheckoutEnabled( - $this->_storeManager->getStore() - ); - } - - /** * Get logo based on chosen color setting * diff --git a/Block/Catalog/Product/View/PaypalExpress.php b/Block/Catalog/Product/View/PaypalExpress.php index afb4540bd..ea1dfc567 100644 --- a/Block/Catalog/Product/View/PaypalExpress.php +++ b/Block/Catalog/Product/View/PaypalExpress.php @@ -56,26 +56,11 @@ public function __construct( $this->encryptor = $encryptor; $this->paypalConfig = $paypalConfig; } - public function canShowProductButton() + public function canShowButton($page) { - if ($this->isModuleActive()){ - return $this->paypalConfig->canShowButtonForPage( - 'Product', - $this->_storeManager->getStore() - ); - } - return false; - } - - public function canShowCartButton() - { - if ($this->isModuleActive()){ - return $this->paypalConfig->canShowButtonForPage( - 'Cart', - $this->_storeManager->getStore() - ); - } - return false; + return $this->isModuleActive() && + $this->paypalConfig->canShowButtonForPage($page, $this->_storeManager->getStore()) && + $this->paypalConfig->isPayPalEnabled($this->_storeManager->getStore()); } /** @@ -88,6 +73,7 @@ public function isModuleActive() $status = $this->configProviderAccount->getActive(); return $status == 1 || $status == 2; } + /** * Get all data required * diff --git a/Model/ConfigProvider/Method/Applepay.php b/Model/ConfigProvider/Method/Applepay.php index 6cfe184ae..b5b686a5a 100644 --- a/Model/ConfigProvider/Method/Applepay.php +++ b/Model/ConfigProvider/Method/Applepay.php @@ -170,4 +170,8 @@ public function getBaseAllowedCurrencies() ]; } + public function isApplePayEnabled($store = null) + { + return $this->getConfigFromXpath(self::XPATH_APPLEPAY_ACTIVE, $store); + } } diff --git a/Model/ConfigProvider/Method/Ideal.php b/Model/ConfigProvider/Method/Ideal.php index e7dab3100..d32c8d64d 100644 --- a/Model/ConfigProvider/Method/Ideal.php +++ b/Model/ConfigProvider/Method/Ideal.php @@ -173,6 +173,11 @@ public function isFastCheckoutEnabled($store = null) return $this->getConfigFromXpath(self::XPATH_IDEAL_FAST_CHECKOUT_ENABLE, $store); } + public function isIDealEnabled($store = null) + { + return $this->getConfigFromXpath(self::XPATH_IDEAL_ACTIVE, $store); + } + public function getLogoColor($store = null) { return $this->getConfigFromXpath(self::XPATH_IDEAL_FAST_CHECKOUT_LOGO, $store); diff --git a/Model/ConfigProvider/Method/Paypal.php b/Model/ConfigProvider/Method/Paypal.php index 01b399c49..f063ae685 100644 --- a/Model/ConfigProvider/Method/Paypal.php +++ b/Model/ConfigProvider/Method/Paypal.php @@ -108,7 +108,7 @@ public function getExpressMerchantId($store = null) return $this->getConfigFromXpath(self::XPATH_PAYPAL_EXPRESS_MERCHANT_ID, $store); } /** - * Test if express button is enabled for the $page + * Test if express button is enabled for the $page * * @param string $page * @@ -124,4 +124,8 @@ public function canShowButtonForPage($page, $store = null) $pages = explode(",", $buttons); return in_array($page, $pages); } + public function isPayPalEnabled($store = null) + { + return $this->getConfigFromXpath(self::XPATH_PAYPAL_ACTIVE, $store); + } } diff --git a/view/frontend/templates/catalog/product/view/applepay.phtml b/view/frontend/templates/catalog/product/view/applepay.phtml index b8a329eef..8be785333 100644 --- a/view/frontend/templates/catalog/product/view/applepay.phtml +++ b/view/frontend/templates/catalog/product/view/applepay.phtml @@ -18,7 +18,7 @@ * @license https://tldrlegal.com/license/mit-license */ ?> -canShowProductButton()): ?> +canShowButton('Product')): ?>
@@ -47,4 +47,4 @@ }
- \ No newline at end of file + diff --git a/view/frontend/templates/catalog/product/view/ideal-fast-checkout.phtml b/view/frontend/templates/catalog/product/view/ideal-fast-checkout.phtml index fb83b3c14..a4081c320 100644 --- a/view/frontend/templates/catalog/product/view/ideal-fast-checkout.phtml +++ b/view/frontend/templates/catalog/product/view/ideal-fast-checkout.phtml @@ -19,7 +19,7 @@ * @license https://tldrlegal.com/license/mit-license */ -if ($block->canShowProductButton()): ?> +if ($block->canShowButton('Product')): ?>