From 83064c04a1d34336e42e98d1a5342d5b6acf0a4a Mon Sep 17 00:00:00 2001 From: Mark Moffat Date: Sun, 22 Mar 2020 14:05:10 +1030 Subject: [PATCH] Clean loading of Payment partial --- app.js | 3 +++ views/themes/Cloth/checkout-payment.hbs | 22 +--------------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/app.js b/app.js index e10b6f0..0ac9704 100644 --- a/app.js +++ b/app.js @@ -96,6 +96,9 @@ handlebars = handlebars.create({ } return total; }, + partial: (provider) => { + return `partials/payments/${provider}`; + }, perRowClass: (numProducts) => { if(parseInt(numProducts) === 1){ return 'col-6 col-md-12 product-item'; diff --git a/views/themes/Cloth/checkout-payment.hbs b/views/themes/Cloth/checkout-payment.hbs index 2932922..c4eb204 100644 --- a/views/themes/Cloth/checkout-payment.hbs +++ b/views/themes/Cloth/checkout-payment.hbs @@ -52,27 +52,7 @@ {{/if}}
{{#if session.customerPresent}} - {{#ifCond config.paymentGateway '==' 'paypal'}} - {{> partials/payments/paypal}} - {{/ifCond}} - {{#ifCond config.paymentGateway '==' 'blockonomics'}} - {{> partials/payments/blockonomics}} - {{/ifCond}} - {{#ifCond config.paymentGateway '==' 'stripe'}} - {{> partials/payments/stripe}} - {{/ifCond}} - {{#ifCond config.paymentGateway '==' 'authorizenet'}} - {{> partials/payments/authorizenet}} - {{/ifCond}} - {{#ifCond config.paymentGateway '==' 'adyen'}} - {{> partials/payments/adyen}} - {{/ifCond}} - {{#ifCond config.paymentGateway '==' 'payway'}} - {{> partials/payments/payway}} - {{/ifCond}} - {{#ifCond config.paymentGateway '==' 'instore'}} - {{> partials/payments/instore}} - {{/ifCond}} + {{> (partial config.paymentGateway) }} {{/if}}