Restrictions for custom fields

  • Posts: 40
  • Thank you received: 1
  • Hikashop Business
2 years 10 months ago #333410

-- HikaShop version -- : HikaShop Business 4.4.3
-- Joomla version -- : 3.9.27
-- PHP version -- : 7

Hello!
We sell hardware and optional software products to extend hardware capabilities. When customer buys both hardware and software in one order, we don't need any additional information. But sometimes customer buys software item only (so he already has the hardware). In this case we must prompt him for his hardware serial number in order to prepare the software.
So I need to create a custom text field to be shown during checkout. I can restrict it to the software category - it's ok. But at the same time I want it to be hidden if there is also a hardware product in the order.
Is there any way to do that?..

Thank you!

Last edit: 2 years 10 months ago by rndm.

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

  • Posts: 81504
  • Thank you received: 13062
  • MODERATOR
2 years 10 months ago #333412

Hi,

Maybe you could do something with the "payment methods" and "shipping methods" restrictions of the custom field.
For example, suppose that you set a weight in your hardware products and no weight in your software products, you could use the minimum weight / maximum weight settings of your shipping methods / payment methods, to display copies of the shipping methods / payment methods you already have. And thus, you could then add a restriction to the custom field so that it would only display for your shipping/payment methods you've configured with a max weight of 0.1. That way, once at least one hardware products is in the cart, the weight will be above that threshold and the other shipping/payment methods with a min weight of 0.1 will appear and thus the custom field won't appear.

The following user(s) said Thank You: rndm

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

  • Posts: 40
  • Thank you received: 1
  • Hikashop Business
2 years 9 months ago #333802

That's a clever way to solve this, thank you so much!

BTW, it's not 100% working. There are some hardware products like spare power adapters that should not affect custom field visibility, but they do since they have weight. But that's a rare situation, I'm fine with 99.9% :)

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

  • Posts: 81504
  • Thank you received: 13062
  • MODERATOR
2 years 9 months ago #333803

Hi,

Maybe you could not have a weight for them ? If the "force shipping regardless of weight" setting is activated in the HikaShop configuration is activated, the customers will still have the shipping method selection on the checkout even if the product in the cart doesn't have a weight.
Now if you need the weight as your shipping methods need it to calculate the shipping fee, then I'm out of options without coding a custom plugin. So if you can live with it, that's unnecessary.

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

Time to create page: 0.055 seconds
Powered by Kunena Forum