bumbummen99 / LaravelShoppingcart

A simple shopping cart implementation for Laravel
MIT License
505 stars 234 forks source link

Add tax per product #180

Closed pixsolution closed 1 year ago

pixsolution commented 1 year ago

Hello, I want to add tax per product (because each product has different tax rates) but I can't find a way and I don't see an explanation of this case in your guide. I have tried the following way: Cart::add([ 'id' => $this->product->id, 'name' => $this->product->title, 'qty' => $this->qty, 'price' => $this->product->price, 'tax' => $this->product->tax, 'weight' => 550, and also with: 'taxRate' => $this->product->tax,

But nothing. How would it be done?

diegonella commented 1 year ago

I can see in the documentation

Cart::setTax($rowId, 21); $cart->setTax($rowId, 21);

Where $rowid Is ítem cart and 21 Is a percentage.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days