Age control upon checkout

  • Posts: 99
  • Thank you received: 4
  • Hikashop Business Hikashop Essential
1 day 12 hours ago #367595

-- Joomla version -- : 5.3.1
-- PHP version -- : 8.3

I have developed a plugin that integrates with mitID (danish ID and age verification). In the plugin I select a Hikashop category for which you eg. need to be more than 21 yeats old. The plugin trigger is onCheckoutStepDisplay. This works fine - only problem is: if the customer want's to remove the restricted products from basket again that is not possible, as the basket is not accessible with thoose restricted products in the basket ? Can I use another trigger for this, eg. when moving to the next step from the basket ? I still need to be able to get the products in the basket inside the plugin.

Last edit: 1 day 12 hours ago by rbuelund.

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

  • Posts: 83937
  • Thank you received: 13599
  • MODERATOR
1 day 9 hours ago #367596

Hi,

How about using the event onBeforeOrderCreate ?
You can set $do to false to cancel the order creation and prevent the user from finishing the checkout.
That way, the user has access to the whole checkout functions.

Also, if you're using onCheckoutStepDisplay to display stuff in the checkout, and you're using onAfterCheckoutStep to do your check, then yes, the operations in the views below in the current step of the checkout will be cancelled.
You could change your checkout workflow to have the cart view in a step before the step with the age verification view. That way, the user could go back a step to change his cart.
Another option would be to display the cart on the side with the HikaShop cart module, not with the cart view.

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

Time to create page: 0.054 seconds
Powered by Kunena Forum