Clean loading of Payment partial

master
Mark Moffat 2020-03-22 14:05:10 +10:30
parent a97ab3fdb0
commit 83064c04a1
2 changed files with 4 additions and 21 deletions

3
app.js
View File

@ -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';

View File

@ -52,27 +52,7 @@
{{/if}}
<form id="shipping-form" class="shipping-form" action="/{{config.paymentGateway}}/checkout_action{{@root.paymentType}}" method="post" role="form" data-toggle="validator" novalidate="false">
{{#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}}
</form>
</div>