hooking to the add to cart event

  • Posts: 44
  • Thank you received: 0
12 years 2 months ago #65910

Is there a way to hook into the add to cart event meaning to see when an item is added to cart and get the current cart then prevent the action if possible. The reason I want to do this is that I need to exercise some constrains on the number of products per cart as well as certain limits of the number of times a product may be purchased by a user.

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

  • Posts: 82818
  • Thank you received: 13362
  • MODERATOR
12 years 1 month ago #66036

You can use the limits button of the products listing to setup such limits without coding.

Otherwise, you can create a hikashop plugin and implement the event onBeforeCartUpdate.
You can look at the file administrator/components/com_hikashop/classes/cart.php for more information on that event.

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

Time to create page: 0.054 seconds
Powered by Kunena Forum