Shop / e-Commerce Integration

Auto assign through plugin

  • dhusband
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 3 months ago #1 by dhusband
Auto assign through plugin was created by dhusband
Morning

Joomla with Hikashop

I have two different Groups in Joomla, Student and People Manager. Students buy for themselves, while People Manager buys for themselves or their children.
I want to improve the experience for students by auto assigning the courses bought. I was thinking of creating a plugin that checked a users Group and if student, assigned the course.

What function would the plugin need to call in Joomdle to undertake the assign?
Any suggestions on what trigger to set the plugin to run?

An alternative would be to have a custom field in Hikashop under Item which is asking if buying for self. The plugin could check if this is equal to Yes and run the assign function?

Thank you
David

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

More
5 years 3 months ago #2 by Antonio Durán
Replied by Antonio Durán on topic Auto assign through plugin
I think your first option is nicer, as it does nor require anything else aside the new plugin.

You would need to call assign_course function, defined in administrator/components/com_joomdle/helpers/parents.php
You may prefer to just use the code inside it, as it is quite specific for the data it expects.

The plugin would need to listen for onAfterOrderUpdate/onAfterOrderCreate, like Joomdle Hikashop system plugin does.
It would need to run after that one, as Joomdle plugin will add the course to be available to assign, and your plugin would assign it.

Please let me know if you need more info.

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

  • dhusband
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 3 months ago #3 by dhusband
Replied by dhusband on topic Auto assign through plugin
Great, I will give it a go.

Thank you

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