Skip to content

Commit

Permalink
Moved recurring report event to other/recurring extension
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCartpenter committed Jun 2, 2024
1 parent 4fdea08 commit 21411ac
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 21 additions & 0 deletions upload/admin/controller/extension/other/recurring.php
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ public function addHistory(): void {
* @return void
*/
public function install(): void {
// Database
$this->db->query("
CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "order_recurring_history` (
`order_recurring_history_id` int(11) NOT NULL AUTO_INCREMENT,
Expand All @@ -734,5 +735,25 @@ public function install(): void {
PRIMARY KEY (`order_recurring_history_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
");

// Event
$this->load->model('setting/event');

$this->model_setting_event->addEvent('recurring_report', 'catalog/model/extension/payment/paypal/addOrderRecurringTransaction/before', 'extension/payment/paypal/addReport', 0, 0);
}

/**
* Uninstall
*
* @return void
*/
public function uninstall(): void {
// Database
$this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "order_recurring_history");

// Event
$this->load->model('setting/event');

$this->model_setting_event->deleteEventByCode('recurring_report');
}
}
2 changes: 0 additions & 2 deletions upload/install/opencart.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1507,8 +1507,6 @@ INSERT INTO `oc_event` (`code`, `trigger`, `action`, `status`, `sort_order`) VAL
('mail_subscription_cancel', 'catalog/model/checkout/order/editOrder/after', 'mail/subscription/cancel', 1, 0);
INSERT INTO `oc_event` (`code`, `trigger`, `action`, `status`, `sort_order`) VALUES
('subscription_charge', 'catalog/model/checkout/order/addHistory/before', 'account/subscription/charge', 1, 0);
INSERT INTO `oc_event` (`code`, `trigger`, `action`, `status`, `sort_order`) VALUES
('recurring_report', 'catalog/model/extension/payment/paypal/addOrderRecurringTransaction/before', 'extension/payment/paypal/addReport', 0, 0);

-----------------------------------------------------------

Expand Down

0 comments on commit 21411ac

Please sign in to comment.