How do I display something in the category/product pages if the product has an attribute called "condition" and is equal to "used"?
@b7itzz You can use the below code for getting the value of condition attribute.
$product->getConditon(); OR $product->getData('condition');
Thanks
@b7itzz yes you can use
if($product->getData('condition') == 'used'): //do whatever if the condition is used. endif;
Thanks
@b7itzz yeah sure and if you stuck then let me know.
If it solves your issue then "Accept it as solution" as it may be useful for others facing the same issue.
Thanks
Unfortunately it ended up not displaying the products on the category pages. I'm trying to add this on /app/design/frontend/*template*/*template_default*/Magento_Catalog/templates/product/price/amount/default.phtml.