Example pages
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!
Re: Example pages
"getRefItems()" is available in all items that implement the \Aimeos\MShop\Common\Item\ListRef\Iface interface, i.e. products, categories, attributes, customers, services, prices and texts.
"$item->price" and "$item->text" is undefined, you need to call
"$item->price" and "$item->text" is undefined, you need to call
Code: Select all
$priceItems = $item->getRefItems( 'price', 'default', 'default' );
$textItems = $item->getRefItems( 'text', 'long' );
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: Example pages
I've tried using it as: {{$item->getRefItems('text', 'long')}}
But it returns "htmlspecialchars() expects parameter 1 to be string, array given"
I've tried intiallizing it in the controller and no luck either.
But it returns "htmlspecialchars() expects parameter 1 to be string, array given"
I've tried intiallizing it in the controller and no luck either.
Re: Example pages
Code: Select all
$item->getRefItems('text', 'long')
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: Example pages
I've tried inserting it into a foreach loop but I still have problems. Would you be able to give me an example?
Re: Example pages
Code: Select all
@foreach ($item->getRefItems('text', 'long') as $text)
<p>{{ $text->getContent() }}</p>
@endforeach
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: Example pages
That works thank you! I didn't know about the getContent(). It isn't registering the <p><strong> tags for some reason though.
Is there a similar method to get the images to load? The getContent() doesn't seem to work for it.
Is there a similar method to get the images to load? The getContent() doesn't seem to work for it.
- Attachments
-
- Screenshot from 2019-02-03 13-54-57.png (17.33 KiB) Viewed 2450 times
Re: Example pages
The "{{ ... }}" automatically escapes the tags. Blade offers a different syntax for unchanged output.
For images, you can use getUrl() or getPreview():
- https://aimeos.org/api/latest/class-Aim ... Iface.html
- https://aimeos.org/api/latest/class-Aim ... Iface.html
For the available methods in the different items, please have a look at the API docs:
https://aimeos.org/api/latest/namespace ... MShop.html
For images, you can use getUrl() or getPreview():
- https://aimeos.org/api/latest/class-Aim ... Iface.html
- https://aimeos.org/api/latest/class-Aim ... Iface.html
For the available methods in the different items, please have a look at the API docs:
https://aimeos.org/api/latest/namespace ... MShop.html
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: Example pages
Cool beans! I managed to have a decent looking page now
Any chance you could tell me how to add the add to basket option on this? And where I can customize the nav bar?
Any chance you could tell me how to add the add to basket option on this? And where I can customize the nav bar?
Re: Example pages
To show the "add to basket" button in the list view, you have to set this configuration option to "1" or true:
https://aimeos.org/docs/Configuration/C ... basket-add
Furthemore, your have to add the "domain" setting descripted in the documentation page.
This works for the standard template. If you created your own template, you have to adapt your template to the functionality of the standard template.
The navigation bar is defined in your app.blade.php template file and managed by Laravel so you have all options Laravel is offering there.
https://aimeos.org/docs/Configuration/C ... basket-add
Furthemore, your have to add the "domain" setting descripted in the documentation page.
This works for the standard template. If you created your own template, you have to adapt your template to the functionality of the standard template.
The navigation bar is defined in your app.blade.php template file and managed by Laravel so you have all options Laravel is offering there.
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: Example pages
To make my own functionality do I just pass the five parameters to a separate function to make it work? Or is there an easier way to update the basket contents?