Post by anoirlol » Mon Jan 29, 2024 7:53 am

Hi there,
Wish good beginng of a week,
So i made a plugin opencart for 3.0.3.2
i want when i add to customer reward point with that + icon i call a function called process the process function is in my plugin controller which the name is ControllerExtensionModuleMembership ,
so i have looked for addReward() function and i found it in admin/controller/sale/order.php add this code

Code: Select all

 
 		$this->load->controller('extension/module/membership');
            	$json['body'] = $this->controller_extension_module_membership->process($order_info['customer_id'], (int) $order_info['reward']);
	
the problem that i get Uncaught Error: Call to a member function process() on null in
what should do where is the problem please thank you!

Newbie

Posts

Joined
Wed Dec 30, 2020 1:23 am

Post by OSWorX » Mon Jan 29, 2024 3:59 pm

I would call the function like this:

Code: Select all

$this->controller_extension_module_membership_process

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by DigitCart » Mon Jan 29, 2024 4:19 pm

You can do it like this:

Code: Select all

$this->load->controller('extension/module/membership/process', $order_info);
But you also need to modify the process function to accept an array as a parameter.

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm

Who is online

Users browsing this forum: No registered users and 62 guests