Skip to content

Commit

Permalink
fixed some cart & checkout total bug
Browse files Browse the repository at this point in the history
  • Loading branch information
indpurvesh committed Mar 20, 2018
1 parent 60e48e3 commit 3a161a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions themes/avored/default/views/cart/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<?php $total = 0; $taxTotal = 0;$giftCouponAmount = 0; ?>
@foreach($cartProducts as $product)

@php
$total += $product->price();
@endphp
@include('cart._single_product', ['product', $product])

@endforeach
Expand Down
14 changes: 8 additions & 6 deletions themes/avored/default/views/checkout/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -756,13 +756,15 @@ class="{{ $errors->has('agree') ? " text-danger" : "" }} agree">
$(function () {
function calcualateTotal() {
subTotal = parseFloat(jQuery('.sub-total').attr('data-sub-total')).toFixed(2);
shippingCost = parseFloat(jQuery('.shipping-cost').attr('data-shipping-cost')).toFixed(2);
taxAmount = parseFloat(jQuery('.tax-amount').attr('data-tax-amount')).toFixed(2);
total = parseFloat(subTotal) + parseFloat(taxAmount) + parseFloat(shippingCost);
jQuery('.total').attr('data-total', total.toFixed(2));
jQuery('.total').html("$" + total.toFixed(2));
var subTotal = parseFloat(jQuery('.sub-total').attr('data-sub-total')).toFixed(2);
var shippingCost = parseFloat(jQuery('.shipping-cost').attr('data-shipping-cost')).toFixed(2);
var taxAmount = 0.00;//parseFloat(jQuery('.tax-amount').attr('data-tax-amount')).toFixed(2);
var total = parseFloat(subTotal + taxAmount + shippingCost).toFixed(2);
jQuery('.total').attr('data-total', total);
jQuery('.total').html("$" + total);
}
Expand Down

0 comments on commit 3a161a4

Please sign in to comment.