Magento 2:自定义支付方式渲染器的模板在哪里
Magento 2: where is the template of the custom payment method renderer
我正在尝试在 Magento 2 中实现自定义支付方式。
我正在关注官方 Magento 2 文档中的文档:http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_payment.html
在名为 "Create the .js component file" 的部分中,我不知道应该在 template
中输入什么:
define(
[
'Magento_Checkout/js/view/payment/default'
],
function (Component) {
'use strict';
return Component.extend({
defaults: {
template: '%path to template%'
},
// add required logic here
});
}
);
所以我尝试从 Magento 的 Paypal 集成中查看实现:
//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'
}
});
}
);
所以我试图找到代码中提到的模板,但该路径对我来说没有任何意义,因为 {magento root dir}/vendor/magento/module-paypal/
中没有这样的文件夹 payment
,所以,我的问题是:那个模板在哪里?
您可以在此处找到此模板:/view/frontend/web/template/payment/payflow-express.html.(http://devdocs.magento.com/guides/v2.1/howdoi/checkout/checkout_payment.html#template)
我正在尝试在 Magento 2 中实现自定义支付方式。 我正在关注官方 Magento 2 文档中的文档:http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_payment.html
在名为 "Create the .js component file" 的部分中,我不知道应该在 template
中输入什么:
define(
[
'Magento_Checkout/js/view/payment/default'
],
function (Component) {
'use strict';
return Component.extend({
defaults: {
template: '%path to template%'
},
// add required logic here
});
}
);
所以我尝试从 Magento 的 Paypal 集成中查看实现:
//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'
}
});
}
);
所以我试图找到代码中提到的模板,但该路径对我来说没有任何意义,因为 {magento root dir}/vendor/magento/module-paypal/
中没有这样的文件夹 payment
,所以,我的问题是:那个模板在哪里?
您可以在此处找到此模板:/view/frontend/web/template/payment/payflow-express.html.(http://devdocs.magento.com/guides/v2.1/howdoi/checkout/checkout_payment.html#template)