Need some help with regex

  • Posts: 5
  • Thank you received: 0
4 years 3 weeks ago #329702

-- url of the page with the problem -- : ohsn-demo.nl/cigowestervoort/index.php/i...824-test-cadeaukaart
-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.24
-- PHP version -- : 7.4.11
-- Browser(s) name and version -- : Firefox.85.0

Hi,

I need to add a gift card to this shop, where the customer is able to order a gift card with a variable price between € 5,- and € 150,-.
So I published the donation plugin, and all works well but...

They can order a gift card with an amount of € 1,-, and that is not an option.

I places this regex: ([5-9]|[1-9][0-9]|1[0-4][0-9]|150)
I found a generator online (because this is like abracadabra to me ;-))
But still it's possible to order a gift card from € 1,-.

Can anyone help me to find where I made a mistake?

Thanks in advance!

Gr.
Bianca

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

  • Posts: 83404
  • Thank you received: 13497
  • MODERATOR
4 years 3 weeks ago #329705

Hi,

The regex will only be checked if the field is required.
Now if you udpate to HikaShop 4.4.1, we've added a hidden option you can use to force the regex to be checked when something is entered in the field even if the field is not required.
To activate that hidden option, go in your phpmyadmin and add an entry with the namekey check_regex_if_not_required and the value 1 in the table hikashop_config.

The following user(s) said Thank You: 12pooh

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

  • Posts: 5
  • Thank you received: 0
4 years 3 weeks ago #329767

Hi Nicolas,

I tried what you suggested, and it works like a charm :-)

Gr,
Bianca

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

Time to create page: 0.055 seconds
Powered by Kunena Forum