Change the drop width and the number of dropdowns greater than 15

  • Posts: 135
  • Thank you received: 5
3 years 5 days ago #339990

-- HikaShop version -- : 4.4.5
-- Joomla version -- : 4.1.0
-- PHP version -- : 7.3.27
-- Browser(s) name and version -- : Brave Version 1.35.103 Chromium: 98.0.4758.102 (Official Build) (64-bit)

When using the quantity input for a product to "Show select"

Which Display View php is this using as the width is not large enough and it needs to be around 56px and not 48px.

Also, there are 15 options in the drop down incremented by 5 as that is the minimum you can order up to 75.

Is there a global option to increase this say to 20 or 25 drop down options.

Also, this product is set to Min of 5 for a certain user, can I make it 100 and incremental of 100 for another user, or do I need to recreate the product with the minimum of 100 for that specific user?

Regards,
MSF

Attachments:
Last edit: 3 years 5 days ago by markfell. Reason: spelling

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

  • Posts: 83402
  • Thank you received: 13495
  • MODERATOR
3 years 5 days ago #339991

Hi,

One solution is to change the quantity input setting of the product from "show select" to "show select price".
In that case, the choices available in the dropdown will be based on the minimum quantity of each price of the product available to the current user.
So you could have several prices with different minimum quantities and different "access levels" so that the choices would be different for different users and the numbers you would like to have. If the current user would have 1000 prices with different minimum quantities, then this dropdown would contain 1000 choices.
The downside of this method is that you need to configure the different prices.

Without using the prices as a basis, then, you can:
- open the hikashop_config table via your PHPMyAdmin and add an entry with the namekey quantity_select_max_default_value and the value 75
That way, the selectable quantity will go up to 75.
- add CSS code like this:

.hikashop_product_quantity_div select { width: 50px !important; }
That way, you can define the width of the dropdown.
- Having different increment and minimum would require either to have different products. That would be the best.
You could edit the product / show_quantity.php and / or the layouts / quantity.php view files via the menu Display>Views.
There, you'll find the HTML for all the different types of quantity inputs.
The 'show_select' is the one you're currently using.
Changing the increment is just about redefining $increment before it is used. But you need to be a developer to add the check on the user. So having a different product would be simpler here I guess.

The following user(s) said Thank You: markfell

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

  • Posts: 135
  • Thank you received: 5
3 years 4 days ago #340010

Nicolas,

Thank you, option 1 with different prices and different quantities for different users is the way forward.
It works perfect and the client is happy with that solution :)

Regards,
MSF

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

Time to create page: 0.056 seconds
Powered by Kunena Forum