mediarox/module-compatibility-amasty-checkout-iways-paypalplus

Compatibility module for the modules iways/module-pay-pal-plus & amasty/module-single-step-checkout.

0.0.5 2022-05-25 14:27 UTC

This package is auto-updated.

Last update: 2024-04-30 00:42:51 UTC


README

Compatibility module for

  • amasty/module-single-step-checkout
  • iways/module-pay-pal-plus

Corrected behaviors

Nr. Topic Problem Fix
1 Positioning of the order button As described in the documentation of Amasty, you can configure the position of the order button in the checkout. As also described there, third-party payment methods sometimes cause problems. This also applies to PayPal Plus payment methods. In case the position "below the order total" is selected, the order buttons of the PayPal Plus payment methods do not move as desired. Extend "Magento_Checkout/js/action/select-payment-method" to inject (mixin) additional move behaviour. Third-party payment methods from the "payment/iways_paypalplus_payment/third_party_moduls" setting of PayPal Plus are also taken into account.
2 isPlaceOrderActionAllowed check An order is normally triggered via the "placeOrder" method (Module_Checkout::js/view/payment/default.js). Among other things, this checks the property "isPlaceOrderActionAllowed" (ko.observable), which is set to "true" if a billing address is available. For registered customers with existing billing addresses, this check does not work correctly in interaction with Amasty Checkout & PayPal Plus, so the order button remains disabled in these cases. We extend the "initPayPalPlusFrame" method (Iways_PayPalPlus::js/view/payment/method-renderer/payment.js) respectively the callback method "enableContinue" contained therein by a check of the Amasty "isPlaceOrderActionAllowed" conditions (Amasty_Checkout::js/view/place-button.js:isPlaceOrderActionAllowed) and set the native property "isPlaceOrderActionAllowed" depending on this.
3 Onepage checkout support The implementation of the PayPal Plus Javascript application "PAYPAL.apps.PPP({})" was implemented rather statically by iways in terms of the standard checkout. Static in this context means that the associated Magento Javascript component reads all configurations (country, language, third-party payment methods) once, starts the application and then only reacts to the change of the country. (billingAddress.subscribe) As soon as you use a onepage checkout and want to implement extended conditions for payment methods, you reach your limits here. In our case, this was the payment method "cash on delivery", which was configured as a third-party payment method and must disappear for certain shipping methods. We extended the PayPal Plus Javascript component to listen for the Amasty event "onAfterShippingSave", which then loads and updates the third-party payment methods via a web api call.

https://github.com/i-ways/magento2-paypal-plus/blob/master/view/frontend/web/js/view/payment/method-renderer/payment.js

Installation

composer require mediarox/module-compatibility-amasty-checkout-iways-paypalplus
bin/magento setup:upgrade

Notice

Further suggestions, corrections or features (pull requests or issues) are welcome.