Limts and Messages

  • Posts: 259
  • Thank you received: 22
2 years 10 months ago #341148

-- url of the page with the problem -- : adherepromotions.com.au
-- HikaShop version -- : 4.5.1
-- Joomla version -- : 3.10.8

We have a store which is a franchise group portal with multiple user groups based on the franchise they work for, all of whom have different product limits set by their franchise. We would like to be able to set message language overrides based on the user group so that the reason for the limit is explained. Is there any way to do this? For example, would it be possible to have a custom field linked to a user group that could be inserted in the message or better still a custom field linked to a Limit rule that is incorporated into the message?

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

  • Posts: 83402
  • Thank you received: 13495
  • MODERATOR
2 years 10 months ago #341154

Hi,

Well, after the limits are checked, the system will trigger the event onAfterProductCheckQuantities(&$products, &$cart, $options)
and the error messages should be available in $cart->messages
So replacing the error messages should be possible with the development of a plugin implementing that event.
So in that event, you can get the user groups of the current user with Joomla's standard functions and then, overwrite the message with your own message based on that.
However, having different messages for different limits would be quite complex without any modifications to the core of HikaShop because in that trigger, there is no way to know which limit rule generated the error message. So it would require extra triggers inside the limit checking system, or at least add extra information attached to the error message in the $cart->messages arrya.

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

  • Posts: 259
  • Thank you received: 22
2 years 10 months ago #341176

Hi Nicholas,
Thanks for the prompt reply. I'll take this back to the client. I suspect the benefit is not worth the work/cost but at least I now know.

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

Time to create page: 0.059 seconds
Powered by Kunena Forum