Quantity field for options?

  • Posts: 31
  • Thank you received: 1
  • Hikashop Business
6 months 2 weeks ago #359846

Hi,

Is there a way to add a quantity field to the options? I want to build a shop with products with options. I know how to do that, except that several options can be ordered more than 1. So let's say I want to buy product X, and then I need to choose if I want option Y one, two, three or more times delivered with product X.

Is there a way to do this? A plugin maybe?

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

  • Posts: 82584
  • Thank you received: 13293
  • MODERATOR
6 months 2 weeks ago #359849

Hi,

It's possible. We've coded a solution for that right within HikaShop but didn't provide any interface to activate it as it is quite a niche request and there are already many options in HikaShop's interface.
To activate it, just edit the file product / option for your frontend template via the menu Display>Views and change the line:
$this->show_option_quantity = false;
to:
$this->show_option_quantity = true;
near the beginning of the file and save.

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

  • Posts: 31
  • Thank you received: 1
  • Hikashop Business
5 months 2 weeks ago #360427

Hi,

Thanks, that was really easy to do.
Is it possible to have the quantity field just on *some* options and not all?

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

  • Posts: 82584
  • Thank you received: 13293
  • MODERATOR
5 months 2 weeks ago #360432

Hi,

It's not impossible. It would require creating a custom field of the table "product", so that you could choose which mode to use in each option product. Then, it would require modifying the code in product / option in order to take into account the value of this custom field instead of just relying on the $this->show_option_quantity variable. This would require modifications in several places of the view file so it's a bit more involved than just changing one line of code. You'll have to hire a PHP / JavaScript developer to be able to do this for you if you're not a developer yourself.

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

Time to create page: 0.059 seconds
Powered by Kunena Forum