Post by rogal127 » Mon Mar 05, 2018 10:42 pm

Hi, i'm working on Open Cart 3.0.2.0.
I want to call my own function after someone buy a product from my store. Where i can call this function? I tried to put the test code in catalog/model/checkout/order.php in addOrder and addOrderHistory methods, but it doesn't work.. Can anyone know in which file and method i should put my own code?

There is piece of my test code:

Code: Select all

 <?php
class ModelCheckoutOrder extends Model {
	public function addOrder($data) {
		//TEST
		file_put_contents('my_directory/test.txt', 'test');
		...
		 
Edit: I know that in older versions was Confirm method i Checkout Model, and there u could pass your code, but it disappeared in new versions.

I can put my code in catalog/controller/success.php, but i need to get and pass informations about all ordered products. Any ideas?

Best regards.

Newbie

Posts

Joined
Mon Mar 05, 2018 10:34 pm

Post by straightlight » Tue Mar 06, 2018 12:06 am

In the catalog/controller/event folder and on your event database table.
For emails: catalog/controller/mail folder and the same for the event database table.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 46 guests