Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I'm trying to hide certain products on my site which has retail and wholesale products. My wholesale products are sorted by vendor with the tag "wholesale". I only want retail products showing unless the customer is logged in.
I'm familiar enough with the code to add this,
{% if customer %}
<!-- Display the product content -->
{% else %}
<!-- Display a message or redirect to a login page -->
{% endif %}
but I am not sure how to go about just hiding just the products that are tagged "wholesale".
Would anyone be able to guide me with this?
Thank you!
Okay, I think I have the code I need, but I am not sure where to put it. It would usually go inside the product.liquid section, but I can't find that one, I see main_product.liquid...would this be where I place the following code?
{% if customer %}
{% for tag in product.tags %}
{% if tag == 'wholesale' %}
<!-- Display product details for wholesale customers -->
<!-- You can place your product content here -->
{% endif %}
{% endfor %}
{% endif %}
Thank you!
The year-end shopping spree is around the corner! Is your online store ready for the ...
By JasonH Nov 10, 2024We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024