Adding icon to product listing image based on attribute value
-
01-10-2020 - |
문제
I am trying to place a text icon on relevant product listing images based on an attribute value ('In Stock'). Can anyone tell me where I am going wrong, as I am crashing the page with the current code.
CURRENT CODE
<?php if($_product->getAttributeText('in_stock')==$this->_('In Stock')): ?>
<div class="product-img-icon-quick">IN STOCK</div>
<?php endif; ?>
The code above is being placed in the relevant area of list.phtml
해결책
This was as simple as missing the __ double underscore in the php code above.
제휴하지 않습니다 magento.stackexchange