diff --git a/lib/common.js b/lib/common.js index d33e138..3adf6f8 100755 --- a/lib/common.js +++ b/lib/common.js @@ -378,10 +378,6 @@ const updateConfig = (fields) => { settingsFile.emailPort = parseInt(fields.emailPort); } - if(fields.flatShipping){ - settingsFile.flatShipping = parseInt(fields.flatShipping); - } - if(fields.productsPerRow){ settingsFile.productsPerRow = parseInt(fields.productsPerRow); } diff --git a/routes/order.js b/routes/order.js index 91db979..a1ccfa4 100644 --- a/routes/order.js +++ b/routes/order.js @@ -123,6 +123,7 @@ router.post('/admin/order/create', async (req, res, next) => { orderPaymentGateway: 'Instore', orderPaymentMessage: 'Your payment was successfully completed', orderTotal: req.session.totalCartAmount, + orderShipping: req.session.totalCartShipping, orderItemCount: req.session.totalCartItems, orderProductCount: req.session.totalCartProducts, orderEmail: req.body.email || req.session.customerEmail, diff --git a/routes/payments/adyen.js b/routes/payments/adyen.js index 19de602..03dd9e2 100644 --- a/routes/payments/adyen.js +++ b/routes/payments/adyen.js @@ -77,6 +77,7 @@ router.post('/checkout_action', async (req, res, next) => { orderPaymentGateway: 'Adyen', orderPaymentMessage: response.refusalReason, orderTotal: req.session.totalCartAmount, + orderShipping: req.session.totalCartShipping, orderItemCount: req.session.totalCartItems, orderProductCount: req.session.totalCartProducts, orderEmail: req.session.customerEmail, diff --git a/routes/payments/authorizenet.js b/routes/payments/authorizenet.js index b96e06a..1773686 100644 --- a/routes/payments/authorizenet.js +++ b/routes/payments/authorizenet.js @@ -60,6 +60,7 @@ router.post('/checkout_action', (req, res, next) => { orderPaymentGateway: 'AuthorizeNet', orderPaymentMessage: 'Your payment was successfully completed', orderTotal: req.session.totalCartAmount, + orderShipping: req.session.totalCartShipping, orderItemCount: req.session.totalCartItems, orderProductCount: req.session.totalCartProducts, orderEmail: req.session.customerEmail, diff --git a/routes/payments/instore.js b/routes/payments/instore.js index 5719a85..8827f96 100644 --- a/routes/payments/instore.js +++ b/routes/payments/instore.js @@ -14,6 +14,7 @@ router.post('/checkout_action', async (req, res, next) => { orderPaymentGateway: 'Instore', orderPaymentMessage: 'Your payment was successfully completed', orderTotal: req.session.totalCartAmount, + orderShipping: 0, orderItemCount: req.session.totalCartItems, orderProductCount: req.session.totalCartProducts, orderEmail: req.session.customerEmail, diff --git a/routes/payments/paypal.js b/routes/payments/paypal.js index e4fc656..4ab4411 100644 --- a/routes/payments/paypal.js +++ b/routes/payments/paypal.js @@ -162,6 +162,7 @@ router.post('/checkout_action', (req, res, next) => { orderPaymentId: payment.id, orderPaymentGateway: 'Paypal', orderTotal: req.session.totalCartAmount, + orderShipping: req.session.totalCartShipping, orderItemCount: req.session.totalCartItems, orderProductCount: req.session.totalCartProducts, orderEmail: req.session.customerEmail, diff --git a/routes/payments/stripe.js b/routes/payments/stripe.js index 4e12e91..8dcc0f8 100644 --- a/routes/payments/stripe.js +++ b/routes/payments/stripe.js @@ -53,6 +53,7 @@ router.post('/checkout_action', (req, res, next) => { orderPaymentGateway: 'Stripe', orderPaymentMessage: charge.outcome.seller_message, orderTotal: req.session.totalCartAmount, + orderShipping: req.session.totalCartShipping, orderItemCount: req.session.totalCartItems, orderProductCount: req.session.totalCartProducts, orderEmail: req.session.customerEmail, @@ -229,6 +230,7 @@ router.post('/checkout_action_subscription', async (req, res, next) => { orderPaymentGateway: 'Stripe', orderPaymentMessage: subscription.collection_method, orderTotal: req.session.totalCartAmount, + orderShipping: req.session.totalCartShipping, orderItemCount: req.session.totalCartItems, orderProductCount: req.session.totalCartProducts, orderEmail: req.session.customerEmail, diff --git a/views/themes/Cloth/cart.hbs b/views/themes/Cloth/cart.hbs index a3df6f5..0f918b4 100644 --- a/views/themes/Cloth/cart.hbs +++ b/views/themes/Cloth/cart.hbs @@ -56,7 +56,7 @@ {{#ifCond @root.session.shippingCostApplied '===' true}}
{{ @root.__ "Shipping" }} - {{currencySymbol @root.config.currencySymbol}}{{formatAmount @root.config.flatShipping}} + {{currencySymbol @root.config.currencySymbol}}{{formatAmount @root.session.totalCartShipping}}
{{else}}
diff --git a/views/themes/Cloth/checkout-payment.hbs b/views/themes/Cloth/checkout-payment.hbs index 07500be..ce74d3d 100644 --- a/views/themes/Cloth/checkout-payment.hbs +++ b/views/themes/Cloth/checkout-payment.hbs @@ -30,7 +30,7 @@ Standard shipping
- {{currencySymbol @root.config.currencySymbol}}{{formatAmount @root.config.flatShipping}} + {{currencySymbol @root.config.currencySymbol}}{{formatAmount @root.session.totalCartShipping}} Change
diff --git a/views/themes/Cloth/checkout-shipping.hbs b/views/themes/Cloth/checkout-shipping.hbs index a37bf6e..022cd58 100644 --- a/views/themes/Cloth/checkout-shipping.hbs +++ b/views/themes/Cloth/checkout-shipping.hbs @@ -15,7 +15,7 @@ {{#unless @root.session.shippingOptions}}