QTY Step

  • Posts: 4
  • Thank you received: 0
1 year 4 months ago #354202

-- HikaShop version -- : 4.7.5
-- Joomla version -- : 4.3.3
-- PHP version -- : 8.1

I have a quantity increase and decrease buttons on my product pages.

These however, increase or decrease by 1, I would like to change it to 5. How can this be done please?

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 4 months ago #354205

Hi,

Edit the view files product / show_quantity and layouts / quantity via the menu Display>Views
There, you'll find the pieces of code:

data-hk-qty-mod="1"
and:
data-hk-qty-mod="-1"
which respectively define the increment and decrement steps.
Change them to use 5 and -5 and it should work like you want.

Alternatively, and without any view customization, you can set the minimum quantity per order to 5 in your product, and set its "quantity input" setting to "show select". This will display a dropdown with the values 5, 10, 15, 20 etc automatically for the quantity selection.

The following user(s) said Thank You: zieasoft

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

  • Posts: 4
  • Thank you received: 0
1 year 4 months ago #354234

Thank you so much, worked like a charm!

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

  • Posts: 4
  • Thank you received: 0
1 year 4 months ago #354236

Just one issue remains, they could over-ride the qty in the cart, can I make the Quantity field read-only for example or change it to a drop-down or plus and minus boxes?

Screenshot attached

Attachments:

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 4 months ago #354242

Hi,

The alternative method I proposed in my previous message will make all the quantity inputs as dropdowns with the same increment. So it would be a quick and easy solution.

Making the quantity read only on the checkout is easy too. Go in the HikaShop configuration page, and under the Checkout tab, change the setting "read only" of the "Cart" view.

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

  • Posts: 4
  • Thank you received: 0
1 year 4 months ago #354256

Amazing, thank you. Works!

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

Time to create page: 0.055 seconds
Powered by Kunena Forum