Skip to content

Commit

Permalink
Fix getAttributeText (#8)
Browse files Browse the repository at this point in the history
* Fix getAttributeText
  • Loading branch information
k-k-spiilmusic authored and luckyraul committed Apr 2, 2018
1 parent 52ee6a8 commit a8d73e5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@ public function getAttrValueByParam($pathToParam, $productId)
public function getAttributeValue($attributeCode, $productId)
{
$product = $this->getProduct($productId);
$value = $product->getAttributeText($attributeCode) !== null

$attrText = $product->getAttributeText($attributeCode);

$value = ($attrText !== null && $attrText !== false)
? $product->getAttributeText($attributeCode)
: $product->getData($attributeCode);

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mygento/base",
"type": "magento2-module",
"version": "2.2.8",
"version": "2.2.9",
"license": "OSL-3.0",
"homepage": "https://github.com/mygento/base",
"description": "Mygento Base",
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Mygento_Base" setup_version="2.2.8"></module>
<module name="Mygento_Base" setup_version="2.2.9"></module>
</config>

0 comments on commit a8d73e5

Please sign in to comment.