Hi,
I am trying to find out how to have my website pricing hidden and no ability to order, until the visitor is logged in. I also need visitors to register for an approved account to be authorised. I am wholesale-only, b2b, so don't not need retail prices visible. Can anyone advise apps?
Thanks.
Solved! Go to the solution
This is an accepted solution.
The documentation for unless says:
Like if, but executes a block of code only if a certain condition is not met (that is, if the result is false).
https://help.shopify.com/themes/liquid/tags/control-flow-tags#unless
So, wrapping the price with {% unless customer %} would hide the price from all logged in customers, but show it to anyone not logged in. I tested your method and was stumped why it wasn't working, until I realized this. The user is looking or the opposite behavior.
I believe you would want to wrap the price and/or add to cart buttons with the following in order to hide the price from non-logged in customers:
{% if customer.has_account == true %}
Your older post about this (https://ecommerce.shopify.com/c/shopify-discussion/t/can-you-hide-prices-and-add-to-cart-buttons-bef...) also has the answer backwards, in the same fashion.
This is an accepted solution.
Hi,
Simply put the section that shows the price (div, paragraph, form) between : {% if customer %} --- {% endif %}.
For instance:
{% if customer %}
<div class="h2 product-single__price">
{% if product.compare_at_price_max > product.price %}
<span class="visuallyhidden compare-price-a11y">{{ 'products.general.sale_price' | t }}</span>
{% else %}
<span class="visuallyhidden price-a11y">{{ 'products.general.regular_price' | t }}</span>
{% endif %}
<span class="product-price" {% if product.compare_at_price > product.price %} class="on-sale"{% endif %}>
{{ product.price | money }}
</span>
{% if product.compare_at_price_max > product.price %}
<span class="visuallyhidden price-a11y">{{ 'products.general.regular_price' | t }}</span>
<del class="compare-price">{{ product.compare_at_price_max | money }}</del>
{% endif %}
</div>
</div>
{% endif %}
Hello @Joanne_Whitney
Please check this Shopify App. I guess it suits your requirments.
Hi florian6, if i want to have a price for paypal and cc and then a seperate button for a check price but it is hidden and needs to be signed in to click and check out with that option how would you advise i proceed.
also would you be interested in helping me put this in place. I would gladly pay you for implementing this.
paradimecoins@gmail.com
We have achieved protected pricing with wholesale priority pricing and all customers must have a verified account ad be logged in. You can check out the project here:
or https://www.2h.media/portfolio/growhaus-supply-co/
We are happy to help answer any questions. You can PM or email me at matthew@2h.media
2H Media is a full service marketing agency and Shopify partner based in Ontario, Canada.
Best regards,
Matthew
User | Count |
---|---|
4 | |
4 | |
3 | |
1 | |
1 |