Reputation: 1447
I am using gloudemans package to build a shopping cart. How do I override Cart::total() so it can output a different value if a user enters a coupon?
For example,
Cart::total() = 200;
$coupon = 20;
Cart::total() = 180;
Upvotes: 0
Views: 1273
Reputation: 1162
Run this command for getting cart.php file in your config/cart.php
php artisan vendor: publish --provider="Gloudemans\Shoppingcart\ShoppingcartServiceProvider" --tag="config"
after that you will get this file you have to update the tax amount from cart.php file like this
and after update you need to do clear your cart and add cart item to your cart page
Upvotes: 2
Reputation: 307
if you use total method laravel shopping cart add tax to real total of prices just use Cart::subtotal()
to get real to total of prices without adding tax to it.
Upvotes: 0