src/scripts/sections/product.js
/**
   * Updates the DOM with specified prices
   *
   * @param {string} productPrice - The current price of the product
   * @param {string} comparePrice - The original price of the product
   */
Updates the DOM with specified prices
@param {string} productPrice - The current price of the product
@param {string} comparePrice - The original price of the product
Updates the DOM with specified prices @param { string } productPrice - The current price of the product @param { string } comparePrice - The original price of the product
updateProductPrices(evt) {
    const variant = evt.variant;
    const $comparePrice = $(selectors.comparePrice, this.$container);
    const $compareEls = $comparePrice.add(
      selectors.comparePriceText,
      this.$container,
    );
    $(selectors.productPrice, this.$container)
      .html(
        formatMoney(variant.price, theme.moneyFormat),
      );
    if (variant.compare_at_price > variant.price) {
      $comparePrice.html(
        formatMoney(variant.compare_at_price, theme.moneyFormat),
      );
      $compareEls.removeClass(cssClasses.hide);
    } else {
      $comparePrice.html('');
      $compareEls.addClass(cssClasses.hide);
    }
  }
updateProductPrices ( evt ) { const variant = evt . variant ; const $comparePrice = $ ( selectors . comparePrice , this . $container ) ; const $compareEls = $comparePrice . add ( selectors . comparePriceText , this . $container , ) ; $ ( selectors . productPrice , this . $container ) . html ( formatMoney ( variant . price , theme . moneyFormat ) , ) ; if ( variant . compare_at_price > variant . price ) { $comparePrice . html ( formatMoney ( variant . compare_at_price , theme . moneyFormat ) , ) ; $compareEls . removeClass ( cssClasses . hide ) ; } else { $comparePrice . html ( '' ) ; $compareEls . addClass ( cssClasses . hide ) ; } }
Updates the DOM with specified prices
 @param {string} productPrice - The current price of the product
 @param {string} comparePrice - The original price of the product
Updates the DOM with specified prices @param { string } productPrice - The current price of the product @param { string } comparePrice - The original price of the product