Hello,
We need to display a different price for customers with a specific customer tag. This is only to DISPLAY specific prices (there is no purchase capability on the site).
Basically for this group of customers we need to display whatever the actual price is and multiply by 2.5.
I was able to do this successfully with Liquid in the product-price.liquid file, and in the product-template.liquid file:
{% if customer.tags contains ‘retail’ %}
{{ current_variant.price | times: 2.5 | money }}
{% else %}
{{ current_variant.price | money }}
{% endif %}
However I’m running into a wall with Javascript. The issue is when the variant changes, it loads the updatePrice JS function which reverts the price shown back to the original price.
I added a new customer metafield called “retail” and I was trying to call it within the updatePrice function:
_updatePrice: function(evt) {
var variant = evt.variant;
var customer_type = customer.metafields.custom.retail.value;
if (customer_type == “retail”) {
variant.price = variant.price * 2.5;
}
But this doesn’t seem to work. Any idea how we can accomplish this, so when variant changes it doesn’t go back to original price (but original price * 2.5)?
Thanks for any suggestions!