Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item Model: item_model_bindings tax is always null #279

Open
dennisoderwald opened this issue Apr 25, 2021 · 4 comments
Open

Item Model: item_model_bindings tax is always null #279

dennisoderwald opened this issue Apr 25, 2021 · 4 comments

Comments

@dennisoderwald
Copy link
Collaborator

dennisoderwald commented Apr 25, 2021

When I add a cart item via a model, all fields are taken over except the tax which is always null.

I can only set the tax in this case as follows:

$model = Model::find(1);
$item = LaraCart::add($model);
$item->tax = $model->tax;
@lukepolo
Copy link
Owner

odd, thanks for the bug report. Still a bit behind on things , if you can make a PR!

@dennisoderwald
Copy link
Collaborator Author

dennisoderwald commented Apr 26, 2021

@lukepolo Thanks Luke. I had already looked at the whole thing yesterday and tried to understand but could not find the bug. I'll take another look today, though.

@lukepolo
Copy link
Owner

lukepolo commented Apr 26, 2021

  'item_model_bindings' => [
        \LukePOLO\LaraCart\CartItem::ITEM_ID      => 'id',
        \LukePOLO\LaraCart\CartItem::ITEM_NAME    => 'name',
        \LukePOLO\LaraCart\CartItem::ITEM_PRICE   => 'price',
        \LukePOLO\LaraCart\CartItem::ITEM_TAXABLE => 'taxable',
        \LukePOLO\LaraCart\CartItem::ITEM_OPTIONS => [
            // put columns here for additional options,
            // these will be merged with options that are passed in
            // e.x
            // tax => .07
        ],
    ],

did you add tax to the item options there?

@dennisoderwald
Copy link
Collaborator Author

Yes, I have. Unfortunately, that didn't change anything. It remains null.

@lukepolo lukepolo added this to the 2.1 milestone Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants