Hide quantity box for specific product

  • Posts: 208
  • Thank you received: 10
3 years 9 months ago #332934

Hikashop 4.2.2

All my products allow customers to type in the quantity box.

Yet there is one product I don't want them to do that.

Is it possible to NOT show the quantity box for just a single product?

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

  • Posts: 83403
  • Thank you received: 13497
  • MODERATOR
3 years 9 months ago #332944

Hi,

Yes. In the settings of each product, you'll find a "quantity input" setting that you can set to "none" to override the "quantity input method" setting of the HikaShop configuration.

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

  • Posts: 208
  • Thank you received: 10
3 years 9 months ago #332974

Thank ye

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

  • Posts: 64
  • Thank you received: 7
  • Hikashop Business
3 years 9 months ago #333547

I was looking for the same but this does not work for me. I have set it to none but the quantity box is still visible (I have deleted cache etc). Is there another setting that has to be made first? I do work with a template override, not sure if that matters. Is it maybe possible to remove it from the template override for the category? Since I need the quantitiy box to only show in one category and not show in all the other categories.

Thanks in advance.

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

  • Posts: 208
  • Thank you received: 10
3 years 9 months ago #333560

On the Product page, there's a section for Display ....

Attachments:

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

  • Posts: 64
  • Thank you received: 7
  • Hikashop Business
3 years 9 months ago #333562

Yes, like I said, I did that, but the quantity box is still visible. So it's not working. Is there another way? Or can I hide it in my template override by removing the code of the quantity box? And if so, what code do I have to change?

Thanks in advance.

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

  • Posts: 208
  • Thank you received: 10
3 years 9 months ago #333563

That I cannot answer .... maybe some else more knowledgeable will chime in.

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

  • Posts: 64
  • Thank you received: 7
  • Hikashop Business
3 years 9 months ago #333566

I have found the answer that is working for me. I have created an override for the show_tabular per category. In every category that I don't need the quality box in, I have changed in the show_tabular override:
$this->setLayout('quantity');
to
$this->setLayout('quantity_nameofoverride');

Then I made an override for the quantity layout. This quantity override I have named quantity_nameofoverride. And in this override I have changed:
$this->setLayout('show_quantity');
to
$this->setLayout('show_quantity_nameofoverride');

And finally I have created an override for layout show_quantity. In this override I have set every input field for hikashop_product_quantity_field to type="hidden".

One point though: I did have to set the "add to cart legacy" to NO.

I don't know if this is the way to do it. But it works for the categories I need it in. In case I have done something utterly stupid, please tell me so.

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

  • Posts: 83403
  • Thank you received: 13497
  • MODERATOR
3 years 8 months ago #333573

Hi,

The add to cart legacy setting has been removed in the 4.4.0. So what you did won't work when you update your HikaShop.
Now, if the "quantity input" setting set to "none" doesn't work for you, it's either a bug of your version of HikaShop, and thus, when you update, you'll just have to revert your changes, or it comes from some customized view override you already had, which was based on an old version of HikaShop, not supporting that "quantity input" setting, and in that case you'll nee to check your overrides.

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

Time to create page: 0.088 seconds
Powered by Kunena Forum