Show Basket Items Count on header
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 40
- Joined: 02 Dec 2021, 17:18
Show Basket Items Count on header
In my Laravel application I am using a common base.blade.php file which is then extended by all other blade files; I have a basket icon present on header part (it is present in that common base.blade.php file)
Now how can I show total number of items present in my basket as a badge of that basket icon ?
How Can I make that count is available for base.blade.php for all the time ?
TIA
Now how can I show total number of items present in my basket as a badge of that basket icon ?
How Can I make that count is available for base.blade.php for all the time ?
TIA

Re: Show Basket Items Count on header
The "basket/mini" component does that by default and you can adapt it to your needs:
- https://github.com/aimeos/aimeos-larave ... hp#L27-L41
- https://github.com/aimeos/ai-client-htm ... asket/mini
- https://github.com/aimeos/aimeos-larave ... hp#L27-L41
- https://github.com/aimeos/ai-client-htm ... asket/mini
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 40
- Joined: 02 Dec 2021, 17:18
Re: Show Basket Items Count on header
I already tried this way of approach; but the basket icon with count is in common blade file, where I can call that "basket/mini" to get count to make it available all the time, with all pages (I have custom pages developed with reference to Laravel approach as well);
Tried calling this "basket/mini" method in AppServiceProvider and shared that count to view; but it is affecting "catelog list" page; showing all shop's products on any shop page;
Provide me any possible method to make this happen
TIA
Tried calling this "basket/mini" method in AppServiceProvider and shared that count to view; but it is affecting "catelog list" page; showing all shop's products on any shop page;
Provide me any possible method to make this happen
TIA
Re: Show Basket Items Count on header
You can also use the JSON API to fetch the basket content and count the number of products yourself:
- https://aimeos.org/docs/latest/frontend ... i/baskets/
- https://aimeos.org/docs/latest/frontend ... -products/
- https://aimeos.org/docs/latest/frontend ... i/baskets/
- https://aimeos.org/docs/latest/frontend ... -products/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
