Get label of attribute type
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 label of attribute type
Hi guys, anyone of you know how to get label of attribute type? I'll explain. In attribute-standard.php of common/partials there is this line of code for print code of attribute type :
<label for="select-<?= $enc->attr( $code ) ?>" class="select-name"><?= $enc->html( $this->translate( 'client/code', $code ) ); ?></label>
but I want to print the label. Anyone know how do it?
<label for="select-<?= $enc->attr( $code ) ?>" class="select-name"><?= $enc->html( $this->translate( 'client/code', $code ) ); ?></label>
but I want to print the label. Anyone know how do it?
Re: Get label of attribute type
The attribute items have like most items a getLabel() method so you can use:
Code: Select all
$attributeItem->getLabel()
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Get label of attribute type
I think I expressed myself badly.
In the product detail page the code related to the type of the attribute is printed, for example if I had a product with 2 attributes of type Shade color whose code is [shade_color] it would be printed:
shade_color << --- attribute type code
attribute1 || attribute 2 << - associated attributes
I would like the code value to be printed and then:
Shade color << - label of the attribute type
attribute1 || attribute 2 << - associated attributes
So given the implementation:
I would like to exploit the $code to receive the relative associated label but not of the attribute but of the attribute type.
I hope I have explained myself better now.
In the product detail page the code related to the type of the attribute is printed, for example if I had a product with 2 attributes of type Shade color whose code is [shade_color] it would be printed:
shade_color << --- attribute type code
attribute1 || attribute 2 << - associated attributes
I would like the code value to be printed and then:
Shade color << - label of the attribute type
attribute1 || attribute 2 << - associated attributes
So given the implementation:
Code: Select all
<? php foreach ($attrTypeDeps as $code => $positions): asort ($positions); ?>
I hope I have explained myself better now.
Re: Get label of attribute type
The attribute type information including the label isn't available in the templates because it's not fetched from the database. This is the reason we use the type codes for translations.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
