Shopify themes, liquid, logos, and UX
Hi all,
I'm looking for a way to stop particular customers from being able to order certain products. Specifically I'm trying to tag customers we do not want to be able to buy our "Pre-Order" items for various reasons. Is there a way of tagging the customer and products in a way where they either do not see them or cannot add them to cart?
Look forward to the feedback
Yes, here's how I would approach this:
1) Find the add to cart button code in your theme
2) Add a conditional Liquid statement to hide the button for customers that have a certain tag, like this:
{% if customer.tags contains "some tag to hide" %}
<p>This is a custom message you can show to them.</p>
{% else %}
regular add to cart button code here
{% endif %}
3) Tag a customer, log in as that customer, and ensure it works according to plan.
I recommend duplicating your live theme first so you can edit code without affecting the live site.
The add to cart code you'll have to search a bit, I would start with the product Template and trace the included snippets to find the one with the button... a lot of times it's named something like product-form.liquid.
If you're not familiar with editing themes, I would read this first: https://speedboostr.com/how-to-safely-edit-your-shopify-theme.
Here's the reference for using Liquid with the customer object.
Thanks I'll give that a try, will that effect all products or just specifically tagged products? Its just certain collections we don't want them able to order
So I've managed to get to it work by adding the and product.tag contains to that tagged product and customer, it removes the add to cart button on the items i don't want ordered but keeps it where i do, thanks for your assistance! However how can I get the text on a single line??
It is possible to stop certain customers from ordering specific products like pre-order products using the Cart Lock https://apps.shopify.com/cart-lock app easily. For this you have to do this:
Now, the tagged customers cannot buy the pre-order items.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By 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, 2024