Skip to content

Can not show Yes/No Attributes on frontend #7267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dinkeronline opened this issue Nov 1, 2016 · 1 comment
Closed

Can not show Yes/No Attributes on frontend #7267

dinkeronline opened this issue Nov 1, 2016 · 1 comment

Comments

@dinkeronline
Copy link

Yes/No Attributes are not visible on frontend due to error in the file

-/Magento/Catalog/Block/Product/View/Attributes.php

function getAdditionalData(array $excludeAttr = []) check if the attributes value is string but in case of Yes/No Attributes the value is something like this -

object(Magento\Framework\Phrase)#2322 (2) { ["text":"Magento\Framework\Phrase":private]=> string(3) "Yes" ["arguments":"Magento\Framework\Phrase":private]=> array(0) { } }

here is the check for string -

if (is_string($value) && strlen($value)) {
$data[$attribute->getAttributeCode()] = [
'label' => __($attribute->getStoreLabel()),
'value' => $value,
'code' => $attribute->getAttributeCode(),
];
}

other attribute types are working fine for me.

@veloraven
Copy link
Contributor

I'm closing this issue as duplicate for #6634

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants