Liquid, JavaScript, themes, sales channels
Hi,
We have a private collection on our website for regular customers. The regular customers are tagged with "vip". Providing they have logged in, they can access our private collection.
For some reason it no longer works. I've double checked the coding and it's exactly as instructed on the tutorial. https://www.youtube.com/watch?v=8Tsm8gkSK-o
Can anyone help? I keep getting phone calls from customers that can't access their products!
Solved! Go to the solution
This is an accepted solution.
Some things I would check:
- Are the tags consistent? (for example "vip" is different than "VIP")
- Are there any console errors on your site that could be interfering with code logic? (if you're not familiar with the console see https://speedboostr.com/finding-and-fixing-console-errors/)
- Does this functionality work on an older theme in preview mode? (that will tell you if changes to a new theme caused the problem)
- Does it function for certain users, or no users
Those checks should help you narrow down the problem (and hopefully solve it). If you can't figure it out and would like a professional Shopify developer to take a look, reach out to my team at speedboostr.com/contact. We work on Shopify sites and apps every day.
This is an accepted solution.
Some things I would check:
- Are the tags consistent? (for example "vip" is different than "VIP")
- Are there any console errors on your site that could be interfering with code logic? (if you're not familiar with the console see https://speedboostr.com/finding-and-fixing-console-errors/)
- Does this functionality work on an older theme in preview mode? (that will tell you if changes to a new theme caused the problem)
- Does it function for certain users, or no users
Those checks should help you narrow down the problem (and hopefully solve it). If you can't figure it out and would like a professional Shopify developer to take a look, reach out to my team at speedboostr.com/contact. We work on Shopify sites and apps every day.
Hi @JoesIdeas
Thanks very much for the information.
I made sure all the tags were "vip" and not "VIP" as there was some variety there.
It came up with "Liquid error: Error in tag 'section' - 'collection' is not a valid section type"
I've managed to sort it (not sure what I did!), and now I can log into our private collection again.
Thanks very much for your help!
I am having the same issue. I believe with this new 2.0 upgrade, the instructions on that video are no longer applicable.
Alguien tiene la solucion para la version 2.0??
Does anyone have the solution for version 2.0??
coding section looks completely different to the tutorial. No idea what to do from here.
I was able to get it to work by updating section to 'main-collection-product-grid' instead of 'collection':
{% if customer.tags contains 'vip' %}
{% section 'main-collection-product-grid' %}
{% else %}
{{ pages.no-access.content }}
{% endif %}
Thank you Hmfedders. Your solution worked for me. I just used the code you suggested.
Hi Hmfedders,
I tried using your code but still unable to get it to work. Do you have any other methods?
Hi,
I still have the problem even after updating the code.
The error is section/collection.liquid does not exist.
Do you have any solution?
Wow!😄 I had exactly the same problems for a looonnng time now. Shopify automatically changes my tags to lowercase starting with a capital letter. So I just changed it to that in my code after reading your comment and I am absolutely happy now. Thanks for sharing this information.
User | RANK |
---|---|
37 | |
28 | |
13 | |
13 | |
9 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023