Quantity Pulldown / Bulk Ordering Feature
13 years 6 months ago #93907
by mindstorm
Quantity Pulldown / Bulk Ordering Feature was created by mindstorm
Can we make the quantity a pulldown or make quantity required by 100's?
We only want to allow orders in bulk... by the 100's:
100
200
300
400
500
600
and so on...
We only want to allow orders in bulk... by the 100's:
100
200
300
400
500
600
and so on...
Please Log in or Create an account to join the conversation.
13 years 6 months ago #93924
by nicolas
Replied by nicolas on topic Quantity Pulldown / Bulk Ordering Feature
Yes, that's possible as explained on that thread:
www.hikashop.com/en/forum/4-how-to/15254...uantity-ordered.html
www.hikashop.com/en/forum/4-how-to/15254...uantity-ordered.html
The following user(s) said Thank You: mindstorm
Please Log in or Create an account to join the conversation.
13 years 6 months ago #94698
by mindstorm
Replied by mindstorm on topic Quantity Pulldown / Bulk Ordering Feature
I have one product that needs a different pulldown quantity? is this possible?
Meaning ALL products use: 100/200/300/400
EXCEPT ONE product needs: 5/10/15/20
Meaning ALL products use: 100/200/300/400
EXCEPT ONE product needs: 5/10/15/20
Please Log in or Create an account to join the conversation.
13 years 6 months ago #94717
by nicolas
Replied by nicolas on topic Quantity Pulldown / Bulk Ordering Feature
Yes, such overrides allow to do that but it's more complex as you need to write PHP code to change the quantity values based on the product where you are.
Please Log in or Create an account to join the conversation.
13 years 6 months ago #94724
by mindstorm
Replied by mindstorm on topic Quantity Pulldown / Bulk Ordering Feature
any advice on where to start with this?
Please Log in or Create an account to join the conversation.
13 years 6 months ago #94728
by nicolas
Replied by nicolas on topic Quantity Pulldown / Bulk Ordering Feature
It's the same as the code of the thread I already gave a link to.
Simply add an if/else based on the product where you are. For example: if you want a specific dropdown for the product with the id 18 :
<?php
function hikashop_quantity_render($html,$i,$max_quantity,$min_quantity){
if(hikashop_getCID('product_id')==18){
return '<select id="hikashop_product_quantity_field_'.$i.'" name="quantity"><option value="25">25</option><option value="50">50</option><option value="75">75</option><option value="100">100</option></select>'.$html;
}else{
return '<select id="hikashop_product_quantity_field_'.$i.'" name="quantity"><option value="50">50</option><option value="100">100</option><option value="200">200</option><option value="500">500</option></select>'.$html;
}
}
Simply add an if/else based on the product where you are. For example: if you want a specific dropdown for the product with the id 18 :
<?php
function hikashop_quantity_render($html,$i,$max_quantity,$min_quantity){
if(hikashop_getCID('product_id')==18){
return '<select id="hikashop_product_quantity_field_'.$i.'" name="quantity"><option value="25">25</option><option value="50">50</option><option value="75">75</option><option value="100">100</option></select>'.$html;
}else{
return '<select id="hikashop_product_quantity_field_'.$i.'" name="quantity"><option value="50">50</option><option value="100">100</option><option value="200">200</option><option value="500">500</option></select>'.$html;
}
}
The following user(s) said Thank You: nui_meibao
Please Log in or Create an account to join the conversation.
Time to create page: 0.212 seconds