darkvirus24
darkvirus24

Reputation: 119

Opencart - In controller, how to call a function from another controller

I have a controller (sale/order.php) with a function generateOrder(). In my another controller (settings.php), I need to call/execute generateOrder() function in sale/order.php controller. How is it possible? Thanks in advance.

I tried:
$ordercontroller = $this->load->controller('sale/order');
$this->ordercontroller->generateOrder();

Upvotes: 1

Views: 3042

Answers (1)

sayli bhagwat
sayli bhagwat

Reputation: 273

to call a function from sale/order.php use

$this->load->controller("sale/order/generateOrder");

Upvotes: 3

Related Questions