How can I add VAT to variant prices using JQuery in the Debut theme?

Am using the Shopify Debut theme and i would like to somehow add vat (7%) to the price of a variation.

Static price i can get working but when changing a variation that has a different price JQuery over-writes this and i dont know how to do this through Jqurey.

This is the jquery snippet from theme.js

/**
 * Trigger event when variant price changes.
 *
 *   {object} variant - Currently selected variant
 *  {event} variantPriceChange
 */
_updatePrice: function(variant) {
  if (
    variant.price === this.currentVariant.price &&
    variant.compare_at_price === this.currentVariant.compare_at_price
  ) {
    return;
  }

  this.$container.trigger({
    type: 'variantPriceChange',
    variant: variant
  });
},

For single price change in the theme template i use this snippet which works.

{{  compare_at_price | times:1.07 | money }}

but how to do this in the Jquery above i don’t know ?

Anyone else manage to get this working thanks ?

I have it working but the issue now is that its multiplying each time you select a variation.

Anyone know Jquery to only trigger the equation time only?

_updatePrice: function(variant) {
  if (
    variant.price === this.currentVariant.price &&
    variant.compare_at_price === this.currentVariant.compare_at_price
  ) {
    return;
  }

  variant.price *= 1.07;
  variant.compare_at_price *= 1.07;

  this.$container.trigger({
    type: 'variantPriceChange',
    variant: variant
  });
},
1 Like

Following… can anyone help?