How to fix the bug of Aheadworks OneStepCheckout not showing a payment module on the frontend checkout screen?

payment
stripe
third-party-extension
aheadworks
aheadworks-one-step-checkout

(Dmitry Fedyuk) #1

The Aheadworks OneStepCheckout contains a bug: it does not wait for payment modules initalization on the frontend checkout screen, so some payment modules could randomly abent at checkout.
To fix this bug, add your module’s initialization script to the define section of the app/code/Aheadworks/OneStepCheckout/view/frontend/web/js/view/payment-method/list.js file.

For example, to make my Stripe module compatible with Aheadworks OneStepCheckout:

locate the code block:

define(
    [
        'jquery',
        'ko',
        'underscore',
        'uiComponent',
        'uiLayout',
        'mageUtils',
        'Magento_Checkout/js/model/quote',
        'Magento_Checkout/js/model/payment/method-list',
        'Magento_Checkout/js/model/payment/renderer-list',
        'Magento_Checkout/js/model/payment-service',
        'Magento_Checkout/js/model/payment/method-converter',
        'Magento_Checkout/js/model/checkout-data-resolver',
        'Aheadworks_OneStepCheckout/js/model/render-postprocessor',
        'Aheadworks_OneStepCheckout/js/model/payment-methods-service',
        'Aheadworks_OneStepCheckout/js/model/checkout-data-completeness-logger'
    ],

and and replace it with the following one:

define(
    [
        'jquery',
        'ko',
        'underscore',
        'uiComponent',
        'uiLayout',
        'mageUtils',
        'Magento_Checkout/js/model/quote',
        'Magento_Checkout/js/model/payment/method-list',
        'Magento_Checkout/js/model/payment/renderer-list',
        'Magento_Checkout/js/model/payment-service',
        'Magento_Checkout/js/model/payment/method-converter',
        'Magento_Checkout/js/model/checkout-data-resolver',
        'Aheadworks_OneStepCheckout/js/model/render-postprocessor',
        'Aheadworks_OneStepCheckout/js/model/payment-methods-service',
        'Aheadworks_OneStepCheckout/js/model/checkout-data-completeness-logger'
        ,'Dfe_Stripe/loader'
    ],

As you can see, the ,'Dfe_Stripe/loader' line was added.

Then re-deploy the static content.