# Pricing Conditions Not Working Properly

**URL:** <https://community.hubspot.com/t/pricing-conditions-not-working-properly/103111>\
**Category:** CMS Development\
**Tags:** design-manager\
**Created:** [March 21, 2024, 3:33pm UTC](https://community.hubspot.com/t/pricing-conditions-not-working-properly/103111 "2024-03-21T15:33:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![IGardner](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/igardner/32/38459_2.png) [@IGardner](https://community.hubspot.com/u/IGardner)\
**Post date:** [March 21, 2024, 3:33pm UTC](https://community.hubspot.com/t/pricing-conditions-not-working-properly/103111/1 "2024-03-21T15:33:14Z")

</div>

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.

```lia-code-sample
 {% 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:

```lia-code-sample
 {% 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?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [March 21, 2024, 8:49pm UTC](https://community.hubspot.com/t/pricing-conditions-not-working-properly/103111/2 "2024-03-21T20:49:38Z")

</div>

Hey, @IGardner 👋 Thanks for your question. Hopefully, someone smarter than me will come along and give us the magic answer. But meanwhile, have you tried something like this?

```lia-code-sample
{% if item2.crmobject_field.properties.eyemagine_advertised_price is defined and item2.crmobject_field.properties.eyemagine_advertised_price > 0 %}
 <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 %}

```

This version checks if `eyemagine_advertised_price` is defined and greater than `0` without comparing it to a string representation of a currency value.

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![IGardner](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/igardner/32/38459_2.png) [@IGardner](https://community.hubspot.com/u/IGardner)\
**Post date:** [March 22, 2024, 3:37pm UTC](https://community.hubspot.com/t/pricing-conditions-not-working-properly/103111/3 "2024-03-22T15:37:13Z")

</div>

Oh my gosh, yes thank you! We only have one developer who has a lot of projects on his hands right now so I’m doing my best to put my limited coding knowledge to use 😅

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [March 22, 2024, 7:57pm UTC](https://community.hubspot.com/t/pricing-conditions-not-working-properly/103111/4 "2024-03-22T19:57:21Z")

</div>

Hey, @IGardner 👋 You’re doing great! I’m glad we could teamwork it and get you moving forward. Have fun building! — Jaycee
