offline
Posts
1
Likes
0
Credits
0
LEVEL
0
60 XP
Hi Azertyop,I think I found a good fix.
- For the cart drawer go to theme code / snippets / cart-drawer.liquid, line 255. Select the whole "cart-item__price-wrapper" div and replace it with the following code.
- If ur gonna use the basic cart page go to theme code / section / main-cart-items.liquid, line 179. Select the whole "cart-item__price-wrapper" div and replace it with the following code.
<div class="cart-item__price-wrapper">
{%- if item.variant.compare_at_price != blank -%}
<div class="cart-item__discounted-prices">
<span class="visually-hidden">
{{ 'products.product.price.regular_price' | t }}
</span>
<s class="cart-item__old-price price price--end">
{{ item.variant.compare_at_price | times: item.quantity | money }}
</s>
<span class="visually-hidden">
{{ 'products.product.price.sale_price' | t }}
</span>
<span class="price price--end">
{{ item.final_line_price | money }}
</span>
</div>
{%- elsif item.original_line_price != item.final_line_price -%}
<div class="cart-item__discounted-prices">
<span class="visually-hidden">
{{ 'products.product.price.regular_price' | t }}
</span>
<s class="cart-item__old-price price price--end">
{{ item.original_line_price | money }}
</s>
<span class="visually-hidden">
{{ 'products.product.price.sale_price' | t }}
</span>
<span class="price price--end">
{{ item.final_line_price | money }}
</span>
</div>
{%- else -%}
<span class="price price--end">
{{ item.original_line_price | money }}
</span>
{%- endif -%}
{%- if item.variant.available and item.unit_price_measurement -%}
<div class="unit-price caption">
<span class="visually-hidden">{{ 'products.product.price.unit_price' | t }}</span>
{{ item.variant.unit_price | money }}
<span aria-hidden="true">/</span>
<span class="visually-hidden"
> {{ 'accessibility.unit_price_separator' | t }} </span
>
{%- if item.variant.unit_price_measurement.reference_value != 1 -%}
{{- item.variant.unit_price_measurement.reference_value -}}
{%- endif -%}
{{ item.variant.unit_price_measurement.reference_unit }}
</div>
{%- endif -%}
</div>
If you added a compare price it will show the compare price. If not it wont show anything, except if you have configured an automatic discount where it will show the original price on top of the discounted price + the individual discounted price if you have more than one of the same product in your cart.
Make sure to test it in depth and tell me what you think.
Thank you very much for your contribution.
Do you know why I can't modify my cart drawer? It's the basic cart drawer and I can't add any features (like the delivery bar, upsell...).
Thank you very much


