Order quantity dropdown for wholesale customers

New Member
4 0 0

Hi,

 

My business sells greeting cards & stationery products to retail customers and wholesale customers. We are using Wholesale Pricing Now for our wholesale app.

 

 

We would like for wholesale customers who are logged in to have a quantity dropdown per item, in multiples of 4 or 6.  Example: https://imgur.com/a/GNp6pZj

 

I'm assuming some js coding would be needed, can anyone help me out?

 

Thank you

 

0 Likes
Shopify Partner
1543 269 328

You can add condition where your qty box generating like bellow:

{% if qty % 4 === 0 %}
         //Here get multiple of 4 
{% endif %}

Note: You cam change 4 to 6.

Change qty to your product qty variable and add in loop where qty generating. 

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
0 Likes
New Member
4 0 0

What file do I edit for this?

 

Thanks

0 Likes
Shopify Partner
1543 269 328

Its depend on your theme. which theme you have?

Mainly qty box added in section->product-template.liquid Or template->product.liquid Or snippet -> product-form.liquid Or snippet->product.liquid

From above any file you can fine product form, in which form qty added. 

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
0 Likes
Highlighted
New Member
4 0 0

I'm just using Minimal theme right now.

 


{% case section.settings.add_to_cart_width %}
{% when 'small' %}
{%- assign btn_class = 'btn--wide' -%}
{%- assign productform_class = 'product-form--wide' -%}
{% when 'medium' %}
{%- assign btn_class = 'btn--wide' -%}
{%- assign productform_class = 'product-form--wide' -%}
{% when 'large' %}
{%- assign btn_class = 'btn--full' -%}
{%- assign productform_class = 'product-form--full' -%}
{% if qty % 6 === 0 %}
//Here get multiple of 6
{% endif %}
{% endcase %}

 

Did I add it in the correct spot?

 

I tried adding the code and got this message:

"Line 13 — Liquid syntax error: Unexpected character % in "qty % 6 === 0"

 

0 Likes
Shopify Partner
1543 269 328

try this:

 <select>
     {% assign num = 16 %}
     {% for i in (1..num) %}
        {% assign num_per = i | modulo:4 %}
        {% if  num_per == 0 %}
             <option> {{ i }} </option>
        {% endif %}
     {% endfor %}
 </select>

Note: Here you can change num=16 to your limit, modulo:4 to your multiplier of 4 or 6.

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
0 Likes