System Plugins, i.e. onAfterCompleteOrder?

More
8 years 8 months ago #65607 by Greg
I see that the code does have some provision for events such as onAfterCompleteOrder, but I can't find a plugin that has the matching code. Is there one available that I can model some customization after, and learn what events are available?

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

  • Giang Dinh Truong
  • Offline
  • Administrator
  • Administrator
More
8 years 8 months ago #65636 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic System Plugins, i.e. onAfterCompleteOrder?
Hello Greg,

There is no plugins use these events now. We only put them there for the developers to develop third party extensions or to integrate EShop with other system. However, you can make a system plugin with function onAfterCompleteOrder($row) with $row is the orders object.

Hope that this will help.
Sincerely, Giang

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

More
6 years 10 months ago #98168 by 70's
Hi, sorry to post on an old topic, but right now I'm struggling to build a system plugin for Eshop and it would be great to see an example to start my plugin.
Did you managed to write your plugin Greg? If yes, could you share it here please?

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

More
6 years 10 months ago #98698 by Greg
Sorry for the long delay...vacation and a PC in the shop.
Here's the skeleton code of my plugin. you'll need to setup a basic/standard Joomla Installer for it.

Note, I discovered that the onCompleteOrder does EXACTLY what it says...when the order is "Complete"...in other words, AFTER payment is received, so don't depend on it to run before that.
Code:
<?php // install to root\plugins\eshop\myplugin\myplugin.php /** * @version 1.3.1 * @package Joomla * @subpackage Membership Pro * @author Tuan Pham Ngoc * @copyright Copyright (C) 2012 - 2014 Ossolution Team * @license GNU/GPL, see LICENSE.php */ defined('_JEXEC') or die(); class plgEshopMyPlugin extends JPlugin { public function __construct(& $subject, $config) { parent::__construct($subject, $config); } /** * @param array of JTable::getInstance('Eshop', 'Order'); */ function onAfterEditOrder($Order) { } function onAfterDeleteOrder($customer_id) { return true; } /** * @param array of JTable::getInstance('Eshop', 'Order'); */ function onAfterCompleteOrder($Order) { } }
The following user(s) said Thank You: Giang Dinh Truong, 70's

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

  • Giang Dinh Truong
  • Offline
  • Administrator
  • Administrator
More
6 years 10 months ago #98714 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic System Plugins, i.e. onAfterCompleteOrder?
That's useful!

Thank you Greg!

Sincerely, Giang

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

Moderators: Giang Dinh Truong