How to get product attribute type name
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: 86
- Joined: 12 Jan 2019, 15:17
How to get product attribute type name
How to get product attribute type name like i want to get media item type name (standard ,Or custom that i made)
Please guide me about this
Thanks
Please guide me about this
Thanks
Re: How to get product attribute type name
The attribute type label isn't part of all attribute items any more. You have to retrieve the type items yourself using something like this:
But for translations, this is a bad choice, you should use the type codes from the attriubte items instead and pass them in the view to:
Code: Select all
$manager = \Aimeos\MShop::create( $context, 'attribute/type' );
$search = $manager->createSearch();
$search->setConditions( $search->compare( '==', 'attribute.type.code', [<codes>] ) );
foreach( $manager->searchItems( $search ) as $typeItem ) {
$label = $typeItem->getLabel();
}
Code: Select all
$this->translate( 'client/code', $typecode );
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
-
- Posts: 86
- Joined: 12 Jan 2019, 15:17
Re: How to get product attribute type name
when i get the product media with thisaimeos wrote: ↑03 Oct 2019, 09:27 The attribute type label isn't part of all attribute items any more. You have to retrieve the type items yourself using something like this:But for translations, this is a bad choice, you should use the type codes from the attriubte items instead and pass them in the view to:Code: Select all
$manager = \Aimeos\MShop::create( $context, 'attribute/type' ); $search = $manager->createSearch(); $search->setConditions( $search->compare( '==', 'attribute.type.code', [<codes>] ) ); foreach( $manager->searchItems( $search ) as $typeItem ) { $label = $typeItem->getLabel(); }
Code: Select all
$this->translate( 'client/code', $typecode );
$this->detailProductItem->getRefItems('media');
This data i am getting of media item
the type value become default.
Re: How to get product attribute type name
The type code is part of all items that has a type column but not the type label.
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