Reputation: 169
I want to show some data if attribute_set is 1 and attributeText is Zero
AttributeSetId = 10 Attribute = myattribute, contain: Zero, One, Force
<?php if ($_product->getAttributeSetId() == "10"): && ($_product->getAttributeText('myattribute') == "Zero"):?>
My data
<?php endif; ?>
What is wrong?
Any help is appreciated.
Resolved by myself :
<?php if ($_product->getAttributeSetId() == "10" && $_product->getAttributeText('myattribute') == "Zero"):?>
Upvotes: 1
Views: 99
Reputation: 2916
Just some misplaced brackets.
<?php
if ($_product->getAttributeSetId() == "10" &&
$_product->getAttributeText('myattribute') == "Zero") {
?>
My data
<?php } ?>
I prefer to use braces but you can use if/endif if you prefer.
Upvotes: 1