Skip to content

Add method to cart instance to get count based on item quantityΒ #15

@bezin

Description

@bezin

Hello,

it would be nice to add a new method to the cart object to get the total number of items based on quantity, eg.

// Cart contains two items A and B, A with quantity 1, B with quantity 3

cart()->count() // Returns 2, because 2 items
cart()->countQuantity() // Return 4, because 1 A and 3 B

One could use this method to display the total number of items in cart in the page header.
Might be better added to ProductList rather than cart.

Cheerio

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions