Shopify themes, liquid, logos, and UX
Hello everyone,
When I search the forum I saw topics similar to the issue that I mentioned, but all of them are explaining according to older themes of shopify.
As I mention at the header, I just want members to see the prices of my products. I know that there are apps like login to view price etc. but if it is still easy to achieve that with codes I don't want to pay monthly to an app.
1) Where should I edit to remove the prices? (I know that I have to edit more than one part)
2) Is this code enough to achieve what I want?
{% if customer %}
<div class="product__price">
{% include 'product-price', variant: current_variant %}
</div>
{% else %}
<b>Our Price:</b> (Dealers Only)
{% endif %}
3) Should I place this code to a spesific line?
Hoping that there is a simple way to achieve that.
Thank you for your attention.
My site is: (ortodontikmalzeme.com)
Solved! Go to the solution
This is an accepted solution.
I do not know how I did it but I somehow do what I want without any help. I do not know anything about coding so this might not be the best way to accomplish this task. I do not guarantee you for the results. Duplicating your theme before editing might be good move. However I never faced a big problem when I am editing the codes. I didn't delete any codes, I just inserted my codes at the beginning and at the end of the codes.
If you want to check how it is working, visit my site. ortodontikmalzeme.com
I used this code:
------------------------------------------------------
{% if customer %}
whole code is here, just add the code at the beginning and at the end
{% else %}
YOUR TEXT HERE (LIKE: LOGIN TO VIEW PRICE)
{% endif %}
---------------------------------------------------------
For hiding the prices on the cart items list, edit:
{% if customer %}
{%- if item.original_price != item.final_price -%}
<div class="cart-item__discounted-prices">
<span class="visually-hidden">
{{ 'products.product.price.regular_price' | t }}
</span>
<s class="cart-item__old-price product-option">
{{- item.original_price | money -}}
</s>
<span class="visually-hidden">
{{ 'products.product.price.sale_price' | t }}
</span>
<strong class="cart-item__final-price product-option">
{{ item.final_price | money }}
</strong>
</div>
{%- else -%}
<div class="product-option">
{{ item.original_price | money }}
</div>
{%- endif -%}
{% else %}
YOUR TEXT HERE (LIKE: LOGIN TO VIEW PRICE)
{% endif %}
----------------------------------------------
{% if customer %}
<div class="cart-item__price-wrapper">
{%- if item.original_line_price != item.final_line_price -%}
<dl class="cart-item__discounted-prices">
<dt class="visually-hidden">
{{ 'products.product.price.regular_price' | t }}
</dt>
<dd>
<s class="cart-item__old-price price price--end">
{{ item.original_line_price | money }}
</s>
</dd>
<dt class="visually-hidden">
{{ 'products.product.price.sale_price' | t }}
</dt>
<dd class="price price--end">
{{ item.final_line_price | money }}
</dd>
</dl>
{%- else -%}
<span class="price price--end">
{{ item.original_line_price | money }}
</span>
{%- endif -%}
{% else %}
YOUR TEXT HERE (LIKE: LOGIN TO VIEW PRICE)
{% endif %}
--------------------------------------------------------------
{% if customer %}
<td class="cart-item__totals right medium-hide large-up-hide">
<div class="loading-overlay hidden">
<div class="loading-overlay__spinner">
<svg aria-hidden="true" focusable="false" role="presentation" class="spinner" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg">
<circle class="path" fill="none" stroke-width="6" cx="33" cy="33" r="30"></circle>
</svg>
</div>
</div>
<div class="cart-item__price-wrapper">
{%- if item.original_line_price != item.final_line_price -%}
<dl class="cart-item__discounted-prices">
<dt class="visually-hidden">
{{ 'products.product.price.regular_price' | t }}
</dt>
<dd>
<s class="cart-item__old-price price price--end">
{{ item.original_line_price | money }}
</s>
</dd>
<dt class="visually-hidden">
{{ 'products.product.price.sale_price' | t }}
</dt>
<dd class="price price--end">
{{ item.final_line_price | money }}
</dd>
</dl>
{%- else -%}
<span class="price price--end">
{{ item.original_line_price | money }}
</span>
{%- endif -%}
{% else %}
YOUR TEXT HERE (LIKE: LOGIN TO VIEW PRICE)
{% endif %}
------------------------------------------
{% if customer %}
<div class="js-contents" {{ block.shopify_attributes }}>
<div class="totals">
<h3 class="totals__subtotal">{{ 'sections.cart.subtotal' | t }}</h3>
<p class="totals__subtotal-value">{{ cart.total_price | money_with_currency }}</p>
{% else %}
YOUR TEXT HERE (LIKE: LOGIN TO VIEW PRICE)
{% endif %}
Welcome to Shopify community,
You mean when Someone login then the price is visible.
Let me know if you are looking this,
I have help many of other peoples to achived this.
Yes this is exactly what I am talking about.
I also am wanting to implement this to my store, but cant find working code.
This is an accepted solution.
I do not know how I did it but I somehow do what I want without any help. I do not know anything about coding so this might not be the best way to accomplish this task. I do not guarantee you for the results. Duplicating your theme before editing might be good move. However I never faced a big problem when I am editing the codes. I didn't delete any codes, I just inserted my codes at the beginning and at the end of the codes.
If you want to check how it is working, visit my site. ortodontikmalzeme.com
I used this code:
------------------------------------------------------
{% if customer %}
whole code is here, just add the code at the beginning and at the end
{% else %}
YOUR TEXT HERE (LIKE: LOGIN TO VIEW PRICE)
{% endif %}
---------------------------------------------------------
For hiding the prices on the cart items list, edit:
{% if customer %}
{%- if item.original_price != item.final_price -%}
<div class="cart-item__discounted-prices">
<span class="visually-hidden">
{{ 'products.product.price.regular_price' | t }}
</span>
<s class="cart-item__old-price product-option">
{{- item.original_price | money -}}
</s>
<span class="visually-hidden">
{{ 'products.product.price.sale_price' | t }}
</span>
<strong class="cart-item__final-price product-option">
{{ item.final_price | money }}
</strong>
</div>
{%- else -%}
<div class="product-option">
{{ item.original_price | money }}
</div>
{%- endif -%}
{% else %}
YOUR TEXT HERE (LIKE: LOGIN TO VIEW PRICE)
{% endif %}
----------------------------------------------
{% if customer %}
<div class="cart-item__price-wrapper">
{%- if item.original_line_price != item.final_line_price -%}
<dl class="cart-item__discounted-prices">
<dt class="visually-hidden">
{{ 'products.product.price.regular_price' | t }}
</dt>
<dd>
<s class="cart-item__old-price price price--end">
{{ item.original_line_price | money }}
</s>
</dd>
<dt class="visually-hidden">
{{ 'products.product.price.sale_price' | t }}
</dt>
<dd class="price price--end">
{{ item.final_line_price | money }}
</dd>
</dl>
{%- else -%}
<span class="price price--end">
{{ item.original_line_price | money }}
</span>
{%- endif -%}
{% else %}
YOUR TEXT HERE (LIKE: LOGIN TO VIEW PRICE)
{% endif %}
--------------------------------------------------------------
{% if customer %}
<td class="cart-item__totals right medium-hide large-up-hide">
<div class="loading-overlay hidden">
<div class="loading-overlay__spinner">
<svg aria-hidden="true" focusable="false" role="presentation" class="spinner" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg">
<circle class="path" fill="none" stroke-width="6" cx="33" cy="33" r="30"></circle>
</svg>
</div>
</div>
<div class="cart-item__price-wrapper">
{%- if item.original_line_price != item.final_line_price -%}
<dl class="cart-item__discounted-prices">
<dt class="visually-hidden">
{{ 'products.product.price.regular_price' | t }}
</dt>
<dd>
<s class="cart-item__old-price price price--end">
{{ item.original_line_price | money }}
</s>
</dd>
<dt class="visually-hidden">
{{ 'products.product.price.sale_price' | t }}
</dt>
<dd class="price price--end">
{{ item.final_line_price | money }}
</dd>
</dl>
{%- else -%}
<span class="price price--end">
{{ item.original_line_price | money }}
</span>
{%- endif -%}
{% else %}
YOUR TEXT HERE (LIKE: LOGIN TO VIEW PRICE)
{% endif %}
------------------------------------------
{% if customer %}
<div class="js-contents" {{ block.shopify_attributes }}>
<div class="totals">
<h3 class="totals__subtotal">{{ 'sections.cart.subtotal' | t }}</h3>
<p class="totals__subtotal-value">{{ cart.total_price | money_with_currency }}</p>
{% else %}
YOUR TEXT HERE (LIKE: LOGIN TO VIEW PRICE)
{% endif %}
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024