- Posts: 1
- Thank you received: 0
Restricting quantity ordered.
- jpak_jfixdesign
-
Topic Author
- Offline
I wanted to thank the developers for making this great program. I am waiting for the UPS shipping plugin to be made, but in the meantime I'm taking the shipping into my own hands.
Now to the question: How can I restrict the quantity that people order? I want to have a drop down box for quantities instead of typing in my own amount. (i.e. 25, 50, 75, 100 and nothing in between). Is this possible?
Thanks!
Please Log in or Create an account to join the conversation.
We are currently preparing the ground for the UPS plugin.
You can set the quantities by creating an override in your template:
You will need to create a file templates/YOUR_TEMPLATE/html/hikashop_button.php with the content:
<?php
function hikashop_quantity_render($html,$i,$max_quantity,$min_quantity){
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;
}
Please Log in or Create an account to join the conversation.
I tried your over-ride method above for the cart page, but it didnt work.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Do you use the latest version of HikaShop ?
Did you replace YOUR_TEMPLATE by the name of the folder of your template ?
Could you double check the path of the file ?
Please Log in or Create an account to join the conversation.
webroot/templates/mytemplatenamehere/html/hikashop_button.php
Please Log in or Create an account to join the conversation.
That override is definitely working everywhere so it should work on your website too. You must be doing something wrong...
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I guess it is not possible to do.
Another question, where in the he11 is this code generated, the width:100% being added to the head of my page is destroying my layout
<style type="text/css">
#hikashop_category_information_menu_111 div.hikashop_subcontainer {
background:#FFFFFF;
}
#hikashop_category_information_menu_111 .hikashop_rtop *,#hikashop_category_information_menu_111 .hikashop_rbottom *{
background:#FFFFFF;
}
#hikashop_category_information_menu_111 div.hikashop_subcontainer {
text-align:center;
}
#hikashop_category_information_menu_111 div.hikashop_container {
text-align:center;
}
#hikashop_category_information_menu_111 div.hikashop_container {
margin:10px 10px;
}
#hikashop_category_information_menu_111 div.hikashop_category,#hikashop_category_information_menu_111 div.hikashop_product{
float:left;
width:100%;
}
</style>
Please Log in or Create an account to join the conversation.
It is generated in administrator/components/com_hikashop/helpers/module.php
That code has to be generated dynamically so that it works properly. You don't want it, an easy solution would be to set a margin of 0 on your menu/module's hikashop options and then set the margin manually in CSS. That will remove the width:100%
Please Log in or Create an account to join the conversation.
Hope this helps.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
also will this need to be changed in ALL of the cart views?
Please Log in or Create an account to join the conversation.
For the carts, you will have to edit the file "cart" of the views "checkout" and "product" and modify the quantity input line. The simplest is to just display the value instead of an input box.
Please Log in or Create an account to join the conversation.
- Posts: 5
- Thank you received: 0
Please Log in or Create an account to join the conversation.