want the option product by default checked

  • Posts: 412
  • Thank you received: 9
  • Hikaserial Subscription Hikashop Business
1 month 3 weeks ago #364208

-- url of the page with the problem -- : bluepoint-concept.nl
-- HikaShop version -- : 5.1.1
-- Joomla version -- : 5.1.4
-- PHP version -- : 8.1.x

Hi,

As you can see i did some modification on the product option view. Instead of dropdown i made a checkbox. How can i set this box by default checked. If i know that i think i can manage to trigger this for only a few prodcuts to be checked by default.
See screenshot.


Can you help me a little with this?
Regards
Mark

Attachments:

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
1 month 3 weeks ago #364210

Hi,

Having checkboxes for options doesn't require any view modification.
You can select the "checkbox" choice in the "Product selection method" setting of the HikaShop configuration and you'll be done.

Now, having the checkboxes checked by default will require a view override of the product / option view file via the menu Display>Views.
You'll need to add a bit of javascript code to get the checkboxes there and check them:
stackoverflow.com/a/63676907

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

  • Posts: 412
  • Thank you received: 9
  • Hikaserial Subscription Hikashop Business
1 month 6 days ago #364556

Thanks again Nicolas,
I managed it to only set by default for certain products.

The following user(s) said Thank You: nicolas

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

Time to create page: 0.069 seconds
Powered by Kunena Forum