I have a Magento website which uses the value of an dropdown (Yes/No) attribute in a if statement condition. The problem I'm having is based on one store view I'm getting '1' and the other is '0' (where '1' is the correct value in this instance).
For example I have this code:
if($_product->getData("lookinsideactive") == 1): if(Mage::app()->getStore()->getId() == 1): echo "Store message 1"; elseif(Mage::app()->getStore()->getId() == 12): echo "Store message 2"; endif; endif;
When I go to store ID 1 the message doesn't appear, but in the store id 12 the message 'Store message 2' appears so the first if statement condition is true.
If I print these:
I get '0' in store ID 1 and '1' in store ID 12.
Where store ID 1 shows 'No' and store ID 12 shows 'Yes'.
Another thing is these conditions work perfectly fine on other products on both store views its just this one product that this result is showing.
So overall the result should be either '1' on both store views for that product or '0' on both store views.
I have checked the attribute set with this problem product and another working product and they both are using the same attribute set, with the same attribute value 'lookinsideactive'.
I am unsure if I've missed something simple but need some advice on a possible cause or some advice to debug this.
Any help is much appreciated, thank you.