Fixed display of shipping amount in cart & populate through to order
parent
eaed663311
commit
445c4f62ff
|
@ -378,10 +378,6 @@ const updateConfig = (fields) => {
|
||||||
settingsFile.emailPort = parseInt(fields.emailPort);
|
settingsFile.emailPort = parseInt(fields.emailPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fields.flatShipping){
|
|
||||||
settingsFile.flatShipping = parseInt(fields.flatShipping);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(fields.productsPerRow){
|
if(fields.productsPerRow){
|
||||||
settingsFile.productsPerRow = parseInt(fields.productsPerRow);
|
settingsFile.productsPerRow = parseInt(fields.productsPerRow);
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,6 +123,7 @@ router.post('/admin/order/create', async (req, res, next) => {
|
||||||
orderPaymentGateway: 'Instore',
|
orderPaymentGateway: 'Instore',
|
||||||
orderPaymentMessage: 'Your payment was successfully completed',
|
orderPaymentMessage: 'Your payment was successfully completed',
|
||||||
orderTotal: req.session.totalCartAmount,
|
orderTotal: req.session.totalCartAmount,
|
||||||
|
orderShipping: req.session.totalCartShipping,
|
||||||
orderItemCount: req.session.totalCartItems,
|
orderItemCount: req.session.totalCartItems,
|
||||||
orderProductCount: req.session.totalCartProducts,
|
orderProductCount: req.session.totalCartProducts,
|
||||||
orderEmail: req.body.email || req.session.customerEmail,
|
orderEmail: req.body.email || req.session.customerEmail,
|
||||||
|
|
|
@ -77,6 +77,7 @@ router.post('/checkout_action', async (req, res, next) => {
|
||||||
orderPaymentGateway: 'Adyen',
|
orderPaymentGateway: 'Adyen',
|
||||||
orderPaymentMessage: response.refusalReason,
|
orderPaymentMessage: response.refusalReason,
|
||||||
orderTotal: req.session.totalCartAmount,
|
orderTotal: req.session.totalCartAmount,
|
||||||
|
orderShipping: req.session.totalCartShipping,
|
||||||
orderItemCount: req.session.totalCartItems,
|
orderItemCount: req.session.totalCartItems,
|
||||||
orderProductCount: req.session.totalCartProducts,
|
orderProductCount: req.session.totalCartProducts,
|
||||||
orderEmail: req.session.customerEmail,
|
orderEmail: req.session.customerEmail,
|
||||||
|
|
|
@ -60,6 +60,7 @@ router.post('/checkout_action', (req, res, next) => {
|
||||||
orderPaymentGateway: 'AuthorizeNet',
|
orderPaymentGateway: 'AuthorizeNet',
|
||||||
orderPaymentMessage: 'Your payment was successfully completed',
|
orderPaymentMessage: 'Your payment was successfully completed',
|
||||||
orderTotal: req.session.totalCartAmount,
|
orderTotal: req.session.totalCartAmount,
|
||||||
|
orderShipping: req.session.totalCartShipping,
|
||||||
orderItemCount: req.session.totalCartItems,
|
orderItemCount: req.session.totalCartItems,
|
||||||
orderProductCount: req.session.totalCartProducts,
|
orderProductCount: req.session.totalCartProducts,
|
||||||
orderEmail: req.session.customerEmail,
|
orderEmail: req.session.customerEmail,
|
||||||
|
|
|
@ -14,6 +14,7 @@ router.post('/checkout_action', async (req, res, next) => {
|
||||||
orderPaymentGateway: 'Instore',
|
orderPaymentGateway: 'Instore',
|
||||||
orderPaymentMessage: 'Your payment was successfully completed',
|
orderPaymentMessage: 'Your payment was successfully completed',
|
||||||
orderTotal: req.session.totalCartAmount,
|
orderTotal: req.session.totalCartAmount,
|
||||||
|
orderShipping: 0,
|
||||||
orderItemCount: req.session.totalCartItems,
|
orderItemCount: req.session.totalCartItems,
|
||||||
orderProductCount: req.session.totalCartProducts,
|
orderProductCount: req.session.totalCartProducts,
|
||||||
orderEmail: req.session.customerEmail,
|
orderEmail: req.session.customerEmail,
|
||||||
|
|
|
@ -162,6 +162,7 @@ router.post('/checkout_action', (req, res, next) => {
|
||||||
orderPaymentId: payment.id,
|
orderPaymentId: payment.id,
|
||||||
orderPaymentGateway: 'Paypal',
|
orderPaymentGateway: 'Paypal',
|
||||||
orderTotal: req.session.totalCartAmount,
|
orderTotal: req.session.totalCartAmount,
|
||||||
|
orderShipping: req.session.totalCartShipping,
|
||||||
orderItemCount: req.session.totalCartItems,
|
orderItemCount: req.session.totalCartItems,
|
||||||
orderProductCount: req.session.totalCartProducts,
|
orderProductCount: req.session.totalCartProducts,
|
||||||
orderEmail: req.session.customerEmail,
|
orderEmail: req.session.customerEmail,
|
||||||
|
|
|
@ -53,6 +53,7 @@ router.post('/checkout_action', (req, res, next) => {
|
||||||
orderPaymentGateway: 'Stripe',
|
orderPaymentGateway: 'Stripe',
|
||||||
orderPaymentMessage: charge.outcome.seller_message,
|
orderPaymentMessage: charge.outcome.seller_message,
|
||||||
orderTotal: req.session.totalCartAmount,
|
orderTotal: req.session.totalCartAmount,
|
||||||
|
orderShipping: req.session.totalCartShipping,
|
||||||
orderItemCount: req.session.totalCartItems,
|
orderItemCount: req.session.totalCartItems,
|
||||||
orderProductCount: req.session.totalCartProducts,
|
orderProductCount: req.session.totalCartProducts,
|
||||||
orderEmail: req.session.customerEmail,
|
orderEmail: req.session.customerEmail,
|
||||||
|
@ -229,6 +230,7 @@ router.post('/checkout_action_subscription', async (req, res, next) => {
|
||||||
orderPaymentGateway: 'Stripe',
|
orderPaymentGateway: 'Stripe',
|
||||||
orderPaymentMessage: subscription.collection_method,
|
orderPaymentMessage: subscription.collection_method,
|
||||||
orderTotal: req.session.totalCartAmount,
|
orderTotal: req.session.totalCartAmount,
|
||||||
|
orderShipping: req.session.totalCartShipping,
|
||||||
orderItemCount: req.session.totalCartItems,
|
orderItemCount: req.session.totalCartItems,
|
||||||
orderProductCount: req.session.totalCartProducts,
|
orderProductCount: req.session.totalCartProducts,
|
||||||
orderEmail: req.session.customerEmail,
|
orderEmail: req.session.customerEmail,
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
{{#ifCond @root.session.shippingCostApplied '===' true}}
|
{{#ifCond @root.session.shippingCostApplied '===' true}}
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
{{ @root.__ "Shipping" }}
|
{{ @root.__ "Shipping" }}
|
||||||
<strong>{{currencySymbol @root.config.currencySymbol}}{{formatAmount @root.config.flatShipping}}</strong>
|
<strong>{{currencySymbol @root.config.currencySymbol}}{{formatAmount @root.session.totalCartShipping}}</strong>
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
Standard shipping
|
Standard shipping
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<span><strong>{{currencySymbol @root.config.currencySymbol}}{{formatAmount @root.config.flatShipping}}</strong></span>
|
<span><strong>{{currencySymbol @root.config.currencySymbol}}{{formatAmount @root.session.totalCartShipping}}</strong></span>
|
||||||
<span class="float-right"><a href="/checkout/shipping">Change</a></span>
|
<span class="float-right"><a href="/checkout/shipping">Change</a></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
{{#unless @root.session.shippingOptions}}
|
{{#unless @root.session.shippingOptions}}
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
{{#if @root.session.shippingCostApplied}}
|
{{#if @root.session.shippingCostApplied}}
|
||||||
<li class="list-group-item">Standard shipping <span class="float-right"><strong>{{currencySymbol @root.config.currencySymbol}}{{formatAmount @root.config.flatShipping}}</strong></span></li>
|
<li class="list-group-item">Standard shipping <span class="float-right"><strong>{{currencySymbol @root.config.currencySymbol}}{{formatAmount @root.session.totalCartShipping}}</strong></span></li>
|
||||||
{{else}}
|
{{else}}
|
||||||
<li class="list-group-item">FREE shipping <span class="float-right"></li>
|
<li class="list-group-item">FREE shipping <span class="float-right"></li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
Loading…
Reference in New Issue