-
Notifications
You must be signed in to change notification settings - Fork 30
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
Missing method #4
Comments
I agree on this one, it would be an easy method to create and would simplify the templates a lot. |
@fhusquinet, @rorc is this a good approach to add the total in each item. For example: use Anam\Phpcart\Cart;
$cart = new Cart();
$cart->add([
'id' => 1001,
'name' => 'Skinny Jeans',
'quantity' => 2,
'price' => 90
]);
$cart->get(1001);
// This will return item with total
[
'id' => 1001,
'name' => 'Skinny Jeans',
'quantity' => 2,
'price' => 90,
'total' => 180
] |
@anam-hossain If the total is updated at the same time the quantity is then that sure would be a great approach. |
@fhusquinet Total will be updated during adding and updating an item. Do you think this will conflict with user content? i mean they can not add total to their own. |
@anam-hossain I hadn't considered that... |
I have to calculate total sum for each item $item->quantity * $item->price...
The text was updated successfully, but these errors were encountered: