diff --git a/upload/admin/controller/extension/other/recurring.php b/upload/admin/controller/extension/other/recurring.php index 57b3e365a..bf31d8a98 100644 --- a/upload/admin/controller/extension/other/recurring.php +++ b/upload/admin/controller/extension/other/recurring.php @@ -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, @@ -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'); } } diff --git a/upload/install/opencart.sql b/upload/install/opencart.sql index beaef529e..cb8fc91ae 100644 --- a/upload/install/opencart.sql +++ b/upload/install/opencart.sql @@ -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); -----------------------------------------------------------