Changing header & body for mini basket?
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!
Changing header & body for mini basket?
Hello
I have added two files in my ext folder I have created under >>
client/html/templates/basket/mini/body-default.php
client/html/templates/basket/mini/header-default.php
and in this file I have this code >>
------
foreach( $this->miniBasket->getProducts() as $product ) {
$quantity += $product->getQuantity();
}
echo $quantiy;
-------
basically when I call this <?= $aiheader['basket/mini'] ?> I want to return the quanity of the basket??
I added this to my balde template <?= $aiheader['basket/mini'] ?> and its returning empty??
what I am doing wrong here?
I have added two files in my ext folder I have created under >>
client/html/templates/basket/mini/body-default.php
client/html/templates/basket/mini/header-default.php
and in this file I have this code >>
------
foreach( $this->miniBasket->getProducts() as $product ) {
$quantity += $product->getQuantity();
}
echo $quantiy;
-------
basically when I call this <?= $aiheader['basket/mini'] ?> I want to return the quanity of the basket??
I added this to my balde template <?= $aiheader['basket/mini'] ?> and its returning empty??
what I am doing wrong here?
Re: Changing header & body for mini basket?
Maybe the content of the basket is cached if you didn't configure otherwise in your dev environment:
https://aimeos.org/docs/Configuration/C ... che/enable
https://aimeos.org/docs/Configuration/C ... che/enable
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Changing header & body for mini basket?
I already have it cached , how can I make sure that when I display this : <?= $aiheader['basket/mini'] ?> . in my blade template I want it to work across the whole site, but right now its not working I am getting undefined error on some pages?aimeos wrote:Maybe the content of the basket is cached if you didn't configure otherwise in your dev environment:
https://aimeos.org/docs/Configuration/C ... che/enable
could you help me?
Thanks
Re: Changing header & body for mini basket?
OK, if you want to use the mini basket component in your own pages (not only those that are offered by the Aimeos Laravel package by default), you should have a look into this article explaining the details:
https://aimeos.org/docs/Laravel/Create_new_pages
https://aimeos.org/docs/Laravel/Create_new_pages
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Changing header & body for mini basket?
Yes I see your point
but I need to make it available in ALL pages Aimeos and my pages , basically in the header.blade I have created that I need to be able to call that array and it will work?
do I need to create a new serviceprovider?
but I need to make it available in ALL pages Aimeos and my pages , basically in the header.blade I have created that I need to be able to call that array and it will work?
do I need to create a new serviceprovider?
Re: Changing header & body for mini basket?
No, you don't. Only configure a new section in your ./config/shop.php:
Add this to your actions:
Then you can use "<?= $aiheader['basket/mini'] ?>" in every template.
Code: Select all
'page' => array(
// ... existing entries
'aimeosall' => array('basket/mini'),
),
Code: Select all
$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'mypage' );
// do some more stuff
return \View::make('mypagetmpl', $params);
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Changing header & body for mini basket?
for this :
$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'mypage' );
// do some more stuff
return \View::make('mypagetmpl', $params);
What you mean add to your action? where exactly?
I am not trying to create a new page I just need to use the $aiheader['basket/mini'] in ALL my template
$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'mypage' );
// do some more stuff
return \View::make('mypagetmpl', $params);
What you mean add to your action? where exactly?
I am not trying to create a new page I just need to use the $aiheader['basket/mini'] in ALL my template
Re: Changing header & body for mini basket?
See the post on Github: https://github.com/aimeos/aimeos-laravel/issues/103
Substitute "catalog/filter" with "basket/mini".
Substitute "catalog/filter" with "basket/mini".
Re: Changing header & body for mini basket?
Thanks
but when you do this in ./config/shop.php you are specifying that variable $aiheader['basket/mini'] in the HOME PAGE only
I need to be able to add this variable if I want in my layout blade template and it will used by all the pages without getting error of undefined
right now I get undefined error on the other pages
but when you do this in ./config/shop.php you are specifying that variable $aiheader['basket/mini'] in the HOME PAGE only
Code: Select all
'page' => array(
// ...
'home' => array( 'catalog/filter' ),
),
right now I get undefined error on the other pages
Re: Changing header & body for mini basket?
In this case, a common Laravel service provider might be really the best option:
https://laravel.com/docs/5.4/views#shar ... -all-views
There you can inject the output of the "Page" object you've defined in the config for all templates.
https://laravel.com/docs/5.4/views#shar ... -all-views
There you can inject the output of the "Page" object you've defined in the config for all templates.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star