The product price is not changing when I change the variant of the product, Maranello 2.0

Hi everyone,

I have just updated my website from Maranello’s old version to the new version 2.0 but there is some issue with the price. In my older version, it used to show 2 prices, one with VAT and other one without VAT and the price used to change based on the variant I select. But in the new version, the price does not change or changes wrong if I change the variant. I tried to fix it and pasted the same custom code for pricing but it’s not working.

Any help?

Hello @Nets4You ,

Have you done the code in the previous version ?

If not I suggest calling the developer who did it alternatively you need to go with a new one to implement it.

Regards
Guleria

Hi @Nets4You

Could you please try reinstalling the theme? Have you checked the “compared at price” feature from the product setting yet?

Best,
Daisy - Avada Support Team.

Hi Nets4You,

Is it possible to share your custom code as well as the store URL? Thanks!

Where can I find the product settings? It’s not in my side bar.

Well, I have added this docs link. You can see the Price.liquid code.

Link : https://docs.google.com/document/d/1WlbWl-OOaIA6pqjGze6YCOpFW1OmRkSjwuzxqadRr2g/edit?usp=sharing

I have also added a screenshot as well.

Hi @Nets4You

I mean this setting here:

Hi Netts4You,
I suggest that you, please print all the below variables in a div/span and check if it has expected value or not.

{%- liquid
	if use_variant
		assign target = product.selected_or_first_available_variant
	else
		assign target = product
	endif

	assign compare_at_price = target.compare_at_price
	assign price = target.price | default: 1999
	assign available = target.available | default: false
	assign money_price = price | money
	if settings.currency_code_enabled
		assign money_price = price | money_with_currency
	endif

	if target == product and product.price_varies
		assign money_price = 'products.product.price.from_price_html' | t: price: money_price
	endif

	assign is_pre_order = false
	if product.template_suffix == 'pre-order' or product.template_suffix == 'pre-order-two-columns'
		assign is_pre_order = true
	endif
-%}

{% assign discounted_price = product.price | times: 1.2 %}

Hi there,

this is Anastis from Truly Fine Pixels, developers of Maranello.

The code you posted has quite a lot of issues, and although it may output wrong prices, it should output at least something most of the times.

Here is a list of issues I can see just by looking at the doc you posted:

  1. The VAT-inclusive price is always calculated as if the VAT is always 20% (that discounted_price = product.price | times: 1.2 line). This is wrong, as different products or market may have different VAT rates: https://help.shopify.com/en/manual/taxes/tax-overrides

  2. The modifications only apply to normal-priced products. Products on sale are not affected.

  3. A lot of assumptions and string manipulations are made using hard-coded constants such as expecting “£” and the word “From”. If you have any other languages or currencies, the code will not work as expected.

  4. The presence of the class incpriceget and the invalid attribute propriceattr=“” suggests the code might have been complemented by additional CSS or JS code. Have you added this code?

  5. The code is based on an older version of the price.liquid file. You’ll not benefit from the bug fixes we’ve made in the new version, and it may be the reason why the price doesn’t update when you change variants.

My first suggestion is to contact the developer/expert that implemented this for you, and have them update it for the new Maranello version.

My second suggestion is to look into apps that can handle dual pricing. Themes don’t have access to the underlying tax information of products, so they can’t reliably show true incl./excl. VAT prices. So, although your developer/expert might “fix” the code you pasted (at least temporarily), the underlying issues will still persist, and you’re very likely going to come across the same issue with a future theme update.

You’re welcome to continue the discussion in the support ticket you already opened with us.