Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello all,
i try to add 19% to prices. Im currently at product.price.liquid
<h2 class="offers">
<span id="price-{{ section.id }}" class="price-preview price price-field product-single__price" itemprop="price">{% if product.selected_or_first_available_variant.price > 0 %}{% if settings.currency_enable %}{{ product.selected_or_first_available_variant.price | money_with_currency }}{% else %}{{ product.selected_or_first_available_variant.price | money }}{% endif %}{% else %}{{ 'products.product.free' | t }}{% endif %}{% if product.selected_or_first_available_variant.compare_at_price > product.selected_or_first_available_variant.price %} <del>{% if settings.currency_enable %}{{ product.selected_or_first_available_variant.compare_at_price | money_with_currency }}{% else %}{{ product.selected_or_first_available_variant.compare_at_price | money }}{% endif %}</del>{% endif %}</span>
<span id="savings-{{ section.id }}" class="savings{% unless product.selected_or_first_available_variant.compare_at_price > product.selected_or_first_available_variant.price %} hidden{% endunless %}"><span>{{ 'products.product.savings' | t }}</span> <span id="compare-{{ section.id }}">{% if settings.currency_enable %}{{ product.selected_or_first_available_variant.compare_at_price | minus: product.selected_or_first_available_variant.price | money_with_currency }}{% else %}{{ product.selected_or_first_available_variant.compare_at_price | minus: product.selected_or_first_available_variant.price | money_without_trailing_zeros }}{% endif %}</span></span>
</h2>
{%- liquid
if shop.taxes_included or shop.shipping_policy.body != blank
echo '<p><small><strong>'
if shop.taxes_included
echo 'products.product.include_taxes' | t
endif
if shop.taxes_included and shop.shipping_policy.body != blank
echo '<span class="separator" aria-hidden="true"></span>'
endif
if shop.shipping_policy.body != blank
echo 'products.product.shipping_policy_html' | t: link: shop.shipping_policy.url
endif
echo '</strong></small></p>'
endif
assign variant = product.selected_or_first_available_variant
-%}
<div id="offer-{{ section.id }}"{% unless product.selected_or_first_available_variant.unit_price_measurement %} class="hidden clearfix"{% endunless %}>{%- render 'product.unitPrice', variant: product.selected_or_first_available_variant -%}</div>
I first used a metafield with " {{ product.price | times: 1.19 | money_without_trailing_zeros }} " and that worked well, so i thought i could use " | times: 1.19 " at " {% else %}{{ product.selected_or_first_available_variant.price | times: 1.19 | money }} " to show the correct price directly. But nothing works and the price dosent change at all. Anyone could tell me my mistake? 😄
After a lot of coffee, I managed to solve it. Can be closed:)
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024