Get supplier id from product
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!
Get supplier id from product
I'm trying to get supplierdata from a product item in a template.
It's in the file ext/<site>/client/html/templates/catalog/detail/body-standard.php
in product list when you are in a category I have this where the products are listed
Everything in the page works, but I need to add supplier-data per product, how do I get that in the template
It's in the file ext/<site>/client/html/templates/catalog/detail/body-standard.php
in product list when you are in a category I have this where the products are listed
Code: Select all
//this is what returns the products
<?php foreach ($this->get('products', []) as $id => $productItem) : ?>
//other code
dump ($productItem->getSupplierItems()); //trying to get supplier data, but does not return any items
//all code to list products
<?php endforeach ?>
_____________
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Re: Get supplier id from product
Make sure that "supplier" is passed as domain while fetching the data. This is done be this configuration:
https://aimeos.org/docs/2021.x/config/c ... l/#domains
To fetch supplier data too use for "client/html/catalog/detail/domains":
https://aimeos.org/docs/2021.x/config/c ... l/#domains
To fetch supplier data too use for "client/html/catalog/detail/domains":
Code: Select all
['attribute', 'media', 'media/property', 'price', 'product', 'product/property', 'supplier', 'text']
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: Get supplier id from product
Thank you, that solved it, once I figured out that I should use /lists/ instead of /detail/ in the conf
_____________
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Re: Get supplier id from product
I have added this to my typoscript
However I am not getting the supplier on the product detail page. What am I doing wrong?
Code: Select all
catalog {
detail {
domains {
0 = attribute
1 = media
2 = media/property
3 = price
4 = product
5 = product/property
6 = text
supplier {
0 = text
1 = media
2 = supplier/address
}
}
}
}
Re: Get supplier id from product
I see his is how it is done in v22
But why do I need to explicitly add this, when it supposedly is the default setting?
Code: Select all
0 = attribute
1 = attribute/property
2 = catalog
3 = media
4 = media/property
5 = price
6 = product
7 = product/property
8 = supplier
9 = supplier/address
10 = text
Re: Get supplier id from product
Did you overwrite "client/html/catalog/domains" before?
catalog/lists: https://github.com/aimeos/ai-client-htm ... #L431-L497
catalog/detail: https://github.com/aimeos/ai-client-htm ... #L281-L321
catalog/lists: https://github.com/aimeos/ai-client-htm ... #L431-L497
catalog/detail: https://github.com/aimeos/ai-client-htm ... #L281-L321
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