Magento 2 – Template of Payment Method Renderer Location

magento2

I am trying to implement a custom payment method inside Magento 2.
I am following this documentation from the official Magento 2 docs: http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_payment.html

In the section called "Create the .js component file", I can't figure out what should I put in template:

define(
    [
        'Magento_Checkout/js/view/payment/default'
    ],
    function (Component) {
        'use strict';
        return Component.extend({
            defaults: {
                template: '%path to template%'
            },
            // add required logic here
        });
    }
);

So I tried to see the implementation from Magento's Paypal integration:

//file {magento root dir}/vendor/magento/module-paypal/view/frontend/web/js/view/payment/method-renderer/payflow-express.js
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
/*browser:true*/
/*global define*/
define(
    [
        'Magento_Paypal/js/view/payment/method-renderer/paypal-express-abstract'
    ],
    function (Component) {
        'use strict';

        return Component.extend({
            defaults: {
                template: 'Magento_Paypal/payment/payflow-express'
            }
        });
    }
);

So I tried to find the template mentioned inside the code, but that path just doesn't make any sense to me since there is no such folder payment inside {magento root dir}/vendor/magento/module-paypal/, so, my question is: where is that template?

Best Answer

Any knockout Js template location inside web dir of that module that means 'Vendor/Module/view/frontend/web/template'

In your case:

/vendor/magento/module-paypal/view/frontend/web/template/payment/payflow-express.html

Equivalent for git magento2 installation :

/app/Code/Magento/Paypal/view/frontend/web/template/payment/payflow-express.html
Related Topic