简体   繁体   English

根据客户标签在 Shopify with Liquid 中隐藏特定产品

[英]Hide specific product in Shopify with Liquid based on customer tags

I'm looking to hide a specific product in Shopify from all customers except those with a certain tag on their account.我希望在 Shopify 中对所有客户隐藏特定产品,但帐户上带有特定标签的客户除外。

I was going to use the app Lockdown but it's been discontinued.我打算使用Lockdown应用程序,但它已停止使用。

So far everything I've learned says that I use something like this:到目前为止,我所学到的一切都表明我使用了这样的东西:

{% if customer.tags contains 'Bundle' %}  
{% include 'product-to-be-shown' %}
{% endif %}

That second line is where I'm stuck, I think I'm on the right track but I'm not entirely sure.第二行是我被卡住的地方,我认为我在正确的轨道上,但我不完全确定。

Any guidance is appreciated, even if that guidance takes me an entirely route to get the solution I'm looking for.感谢任何指导,即使该指导为我提供了一条完整的途径来获得我正在寻找的解决方案。

Close.. but no cigar...关闭...但没有雪茄...

On your product template... use this instead...在您的产品模板上...改用它...

{% if customer.tags contains 'Bundle' %}  

   Show this product as usual. 

{% else %}

   Politely tell this customer there is nothing here for them

{% endif %}

That is all any lockdown or other wholesale App does anyway... absolutely nothing special...无论如何,这就是任何锁定或其他批发应用程序所做的一切......绝对没有什么特别的......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM