Background: We have multiple pricing structures on our website as some of our vendors have a minimum advertised price (MAP) and we can’t show the lower sell price unless the shopper adds it to their cart.
For product emails, I’m trying to make it so if a MAP value(eyemagine_advertised_price) is defined, it should output that price, and if it’s not, to default to unit price. I originally tried the below code, which worked.
{% if item2.crmobject_field.properties.eyemagine_advertised_price is defined %}
<span style="color: #000000;">{{ item2.crmobject_field.properties.eyemagine_advertised_price|format_currency("en-US", "USD") }}</span>
{% else %}
<span style="color: #000000;">{{ item2.crmobject_field.properties.price|format_currency("en-US", "USD") }}</span>
{% endif %}
However, some of our products seem to have a MAP value of $0, and I want to make sure that doesn’t show up. I updated to include MAP needs to be defined and does not equal $0.00:
{% if item2.crmobject_field.properties.eyemagine_advertised_price is defined and item2.crmobject_field.properties.eyemagine_advertised_price != '$0.00' %}
<span style="color: #000000;">{{ item2.crmobject_field.properties.eyemagine_advertised_price|format_currency("en-US", "USD") }}</span>
{% else %}
<span style="color: #000000;">{{ item2.crmobject_field.properties.price|format_currency("en-US", "USD") }}</span>
{% endif %}
It broke the code and will now only show the unit price.
Is there a simple fix for this or will I have to have my ecommerce integration partner update our sync settings to exclude anything that shows as $0?