Modified code for Product-Price showing on first variant but not on any changes.

New Member
1 0 0

Hello everyone!

Im working on a store where we will be offering devices on a monthly plan vs outright purchase. We needed to make some changes to the code to reflect this pricing strategy. See image below.

Screen Shot 2020-11-19 at 12.18.29 PM.png 

This is exactly how we want it but when a user changes the variant to a new selection the price code reverts to just the outright price. See image

Screen Shot 2020-11-19 at 12.20.00 PM.png










After a day of tweaking the code around I cant seem to locate how and where to make this not happen. Im not illiterate when it comes to coding but a not skilled when it comes to liquid. This is the code that Im doing that does the math based of the price of the item. This is located in product-price.liquid. This is on the debut theme fo those who are wondering.

    <div class="price__regular">
        <span class="visually-hidden visually-hidden--inline">{{ 'products.product.regular_price' | t }}</span>
        <span class="price-item price-item--regular" data-regular-price>
          {{ product.price | divided_by: 24 | money }} for 24 months.<sup>1</sup><br>
          <small><p style="font-weight: 300;">{{ money_price }} outright.</p></small>


Please let me know if you have questions and thanks in advance for those who can help me.

21 1 10

Did you figure out how to get this to work? We are trying to show a lease payment option on products, but it just shows the default price and doesn't change with the variant.