我创建了两组客户,他们被标记为批发


“第一次批发商”
“批发商”


我目前正在使用此代码,由于这2个组被标记为批发,因此我无法过滤谁是首次批发商。



{% if customer.tags contains 'wholesale' %}
<p> minimum order is $500</p>
{% else %}
<p> minimum order is $300</p>
{% endif %}





是否有可用于这些组的变量/代码?
(例如。)
{%如果customer.accepts_marketing%}

还是有办法获得解决方案?

最佳答案

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

          <!--if first time wholesale customer-->
          {% if customer.orders_count == 0 %}
          {% if cart.total_price >= 50000 %}
          <span><input type="submit" name="checkout" class="btn uppercase btn--large checkout__button" value="{{ 'cart.general.checkout' | t }}"></span>
          {% else %}
          <p style="color: red;">Order must be minimum of $500 <br />for first time wholesaler.</p>
          {% endif %}


          <!--if not first time wholesale customer-->
          {% else %}
          {% if cart.total_price >= 30000 %}
          <span><input type="submit" name="checkout" class="btn uppercase btn--large checkout__button" value="{{ 'cart.general.checkout' | t }}"></span>
          {% else %}
          <p style="color: red;">Order must be minimum of $300 <br />for wholesaler.</p>
          {% endif %}
          {% endif %}


          {% else %}

          <!--just a regular customer-->
          {% if cart.total_price >= 30000 %}
          <span><input type="submit" name="checkout" class="btn uppercase btn--large checkout__button" value="{{ 'cart.general.checkout' | t }}"></span>
          {% else %}
          <p style="color: red;">Order must be minimum of $300 <br /></p>
          {% endif %}

          {% endif %}

09-27 11:01