Closed sam-hsbu closed 2 years ago
@sergomet that's what I tried of course but it doesn't work :
You can optional pass different taxrates to the items.
Cart::add('293ad', 'Product 1', 1, 9.99, ['size' => 'large'], 20);
Yes it doesnt work
@sam-hsbu I solved it:
on /vendor/hardevine/shoppincart/src/Cart.php after line 485 I added this line:
$cartItem->setTaxRate($id['taxrate']);
hope it helps
i am new in laravel i use shopping cart package how to use this package i dont understand about the quick usage condition
Why has this been closed? It's still not possible to submit the taxrate within an array in Cart:add($array);
this should be fixed by modifying createCartItem method
on /vendor/hardevine/shoppincart/src/Cart.php line 470, 471
$cartItem = CartItem::fromBuyable($id, $options ?: []); //previous $qty
$cartItem->setQuantity($qty ?: 1); // previous $name
and the call should be like this to match add method signature in Cart.php
Cart::add($product, null, $qty, null, $options, $taxrate);
Hello every one.
I would like to specify a taxrate in Cart::Add() like that :
but it doesn't work.
I know we can specify the tax in the "config/cart.php" file but in this case I would like to specify directly in the Cart::Add().
I hope you can understand my request.
Thanks.
Regards.