<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Pricing Conditions Not Working Properly in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Pricing-Conditions-Not-Working-Properly/m-p/948413#M42076</link>
    <description>&lt;P&gt;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&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Mar 2024 15:37:13 GMT</pubDate>
    <dc:creator>IGardner</dc:creator>
    <dc:date>2024-03-22T15:37:13Z</dc:date>
    <item>
      <title>Pricing Conditions Not Working Properly</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Pricing-Conditions-Not-Working-Properly/m-p/947663#M42074</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  {% if item2.crmobject_field.properties.eyemagine_advertised_price is defined %}
            &amp;lt;span style="color: #000000;"&amp;gt;{{ item2.crmobject_field.properties.eyemagine_advertised_price|format_currency("en-US", "USD") }}&amp;lt;/span&amp;gt;
        {% else %}
            &amp;lt;span style="color: #000000;"&amp;gt;{{ item2.crmobject_field.properties.price|format_currency("en-US", "USD") }}&amp;lt;/span&amp;gt;
        {% endif %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;        {% if item2.crmobject_field.properties.eyemagine_advertised_price is defined  and item2.crmobject_field.properties.eyemagine_advertised_price != '$0.00' %}
            &amp;lt;span style="color: #000000;"&amp;gt;{{ item2.crmobject_field.properties.eyemagine_advertised_price|format_currency("en-US", "USD") }}&amp;lt;/span&amp;gt;
        {% else %}
            &amp;lt;span style="color: #000000;"&amp;gt;{{ item2.crmobject_field.properties.price|format_currency("en-US", "USD") }}&amp;lt;/span&amp;gt;
        {% endif %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It broke the code and will now only show the unit price.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 17:44:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Pricing-Conditions-Not-Working-Properly/m-p/947663#M42074</guid>
      <dc:creator>IGardner</dc:creator>
      <dc:date>2024-03-21T17:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Pricing Conditions Not Working Properly</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Pricing-Conditions-Not-Working-Properly/m-p/947905#M42075</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/201636"&gt;@IGardner&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; 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?&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;{% if item2.crmobject_field.properties.eyemagine_advertised_price is defined and item2.crmobject_field.properties.eyemagine_advertised_price &amp;gt; 0 %}
    &amp;lt;span style="color: #000000;"&amp;gt;{{ item2.crmobject_field.properties.eyemagine_advertised_price|format_currency("en-US", "USD") }}&amp;lt;/span&amp;gt;
{% else %}
    &amp;lt;span style="color: #000000;"&amp;gt;{{ item2.crmobject_field.properties.price|format_currency("en-US", "USD") }}&amp;lt;/span&amp;gt;
{% endif %}
&lt;/LI-CODE&gt;
&lt;P&gt;This&amp;nbsp;&lt;SPAN&gt;version checks if &lt;/SPAN&gt;&lt;CODE&gt;eyemagine_advertised_price&lt;/CODE&gt;&lt;SPAN&gt; is defined and greater than &lt;/SPAN&gt;&lt;CODE&gt;0&lt;/CODE&gt;&lt;SPAN&gt; without comparing it to a string representation of a currency value.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jaycee&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 20:49:38 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Pricing-Conditions-Not-Working-Properly/m-p/947905#M42075</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2024-03-21T20:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Pricing Conditions Not Working Properly</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Pricing-Conditions-Not-Working-Properly/m-p/948413#M42076</link>
      <description>&lt;P&gt;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&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 15:37:13 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Pricing-Conditions-Not-Working-Properly/m-p/948413#M42076</guid>
      <dc:creator>IGardner</dc:creator>
      <dc:date>2024-03-22T15:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Pricing Conditions Not Working Properly</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Pricing-Conditions-Not-Working-Properly/m-p/948563#M42077</link>
      <description>&lt;P&gt;Hey, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/201636"&gt;@IGardner&lt;/a&gt;&lt;/SPAN&gt; &lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; You're doing great! I'm glad we could teamwork it and get you moving forward. Have fun building! — Jaycee&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 19:57:21 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Pricing-Conditions-Not-Working-Properly/m-p/948563#M42077</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2024-03-22T19:57:21Z</dc:date>
    </item>
  </channel>
</rss>

