Announcement

Collapse
No announcement yet.

Conditional help for base prod price is 0.00. Attributes have prices

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Conditional help for base prod price is 0.00. Attributes have prices

    After spending hours on this situation, I humbly ask for help. Owner wants a "select one" dropdown for variants. Some have a base price of 0 and the variant price is set by the inventory product. I have been unsuccessful in writing a conditional to hide the $0.00 base price until a variant is selected. I understand that setting an attribute as a default solves this however, the owner wants the "select one". Listed below is the current code for the pricing display

    <div id="js-price-value" class="h3 charcoal nm" data-base-price="&mvt:product:price;">&mvt:product:formatted _price;</div>

    Any help or direction is appreciated.

    #2
    We have a similar setup. Here's the conditional we use:

    Code:
    <mvt:if expr="l.settings:product:price NE '0.00'">&mvt:product:formatted_price;<mvt:else>Select a Size for Pricing &amp; Details</mvt:if>
    Here's your complete example:

    Code:
    <div id="js-price-value" class="h3 charcoal nm" data-base-price="&mvt:product:price;"><mvt:if expr="l.settings:product:price NE '0.00'">&mvt:product:formatted_price;<mvt:else>Select a Size for Pricing &amp; Details</mvt:if></div>
    Ron Frigon
    Jedi Webmaster Obi-Ron Kenobi

    Comment


      #3
      Thank you Ron. Works like a charm.

      Comment

      Working...
      X