diff --git a/templates/index.liquid b/templates/index.liquid index c41f757..59e8919 100644 --- a/templates/index.liquid +++ b/templates/index.liquid @@ -10,7 +10,7 @@ {% endunless %} - +
@@ -19,7 +19,7 @@ {{ breadcrumbs }} {% endif %} - {% paginate products by 12 %} + {% paginate products by 12 %} {% if products.size > 0 %} {% if keywords != nil %} @@ -33,15 +33,20 @@
{% assign image = product.featured_image %} {% if image == nil %} - No image + No image {% else %} - {{ image.alt }} + {{ image.alt }} {% endif %}

{{ product.name }}

-

{{ product.price_with_currency }}

- + {% if current_user.is_wholesale? == true %} + {% assign product_price_with_currency = product.wholesale_price_with_currency %} + {% else %} + {% assign product_price_with_currency = product.price_with_currency %} + {% endif %} +

{{ product_price_with_currency }}

+ {% endif %} @@ -66,11 +71,11 @@ {% endif %}
- + - + {% endpaginate %} - +
diff --git a/templates/show.liquid b/templates/show.liquid index 1d10e94..fa264c2 100644 --- a/templates/show.liquid +++ b/templates/show.liquid @@ -142,9 +142,14 @@ // (needs to be in a liquid file) {% if product.has_variants? %} {% for variant in product_variants %} + {% if current_user.is_wholesale? == true %} + {% assign variant_price = variant.wholesale_price %} + {% else %} + {% assign variant_price = variant.price %} + {% endif %} {% capture first_index %}{{ forloop.index0 }}{% endcapture %} window.product_variants[{{ first_index }}] = { - "price": "{{ variant.price }}", + "price": "{{ variant_price }}", "options_text": "{{ variant.options_text }}", "image": "{{ variant.featured_image.src }}" };