Restricting quantity ordered.

  • Posts: 1
  • Thank you received: 0
13 years 7 months ago #15254

Good afternoon,

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.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 6 months ago #15272

Hi,

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.

  • Posts: 6
  • Thank you received: 0
13 years 6 months ago #16948

I need this to work on both the product and the cart/checkout page.

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.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 6 months ago #16953

For the cart/checkout, you need to directly edit the cart file of the views checkout and product via the menu Display->Views and change the code which displays the input field.

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 0
13 years 6 months ago #16957

ok, thats fine, but how do i display a dropdown menu on the product page instead of a text box, your over ride does not work.

Please Log in or Create an account to join the conversation.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 6 months ago #16958

The override should work.
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.

  • Posts: 6
  • Thank you received: 0
13 years 6 months ago #16961

I am using professional version: "You have the latest stable version : 1.5.0"



webroot/templates/mytemplatenamehere/html/hikashop_button.php

Please Log in or Create an account to join the conversation.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 6 months ago #16966

Are you sure that you put the override in the good template ?
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.

  • Posts: 6
  • Thank you received: 0
13 years 6 months ago #16970

Is it maybe possible this code doesnt work in Joomla1.6?

Please Log in or Create an account to join the conversation.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 6 months ago #16973

No. That code is called directly by HikaShop so it's the same for 1.5 and 1.6

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 0
13 years 6 months ago #16977

Well I assure you it is in the right folder, when i add plain text to the file it shows up above the product detail - see the attached. So your code isnt working.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 6 months ago #16982

Could you send us an FTP access and back end access to your website so that we can check on the problem ?

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 0
13 years 6 months ago #17040

No, this is a client website that I can not provide access to.

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.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 6 months ago #17055

That code IS working and has been used by other users of HikaShop with success. There must be a problem with how you're setting it up on your website but I'm out of ideas as I already told you the different possibilities I could think of.

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.

  • Posts: 11
  • Thank you received: 0
13 years 3 weeks ago #28975

I also tried this modification and found that it only works if the option for "Display the quantity field on the product page" is set to Ajax Input. When set to "normal" the dropdown does not appear.

Hope this helps.

Please Log in or Create an account to join the conversation.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 3 weeks ago #28977

Ah yes, that's a good remark!

Please Log in or Create an account to join the conversation.

  • Posts: 69
  • Thank you received: 5
11 years 8 months ago #94699

Where do we update this in the Cart View? I tried changing the input 'text' to 'select' and it did not work?

also will this need to be changed in ALL of the cart views?

Please Log in or Create an account to join the conversation.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
11 years 8 months ago #94733

The code on this thread is to change the quantity input field to a dropdown on the product page.

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
9 years 8 months ago #194254

thanks!

Last edit: 9 years 8 months ago by nui_meibao. Reason: found the solution.

Please Log in or Create an account to join the conversation.

Time to create page: 0.142 seconds
Powered by Kunena Forum