Post by xinxilas » Thu May 03, 2018 12:37 am

Hello friends

How can i get data from another, preventing using twice same scripts?

For example, im making a simple module which needs to get some datas from category
In this case: Category Description, and total products...

It would be inside content(to add at some layout on left/right columns)
So probably at this time, before run the module, controller/prodcut/category.php has already run.

How can i get (for example)

Code: Select all

$data['description']
$data['product_total']
Directly from controller/prodcut/category.php

To run {{ product_total }} at my extension twig file?

New member

Posts

Joined
Mon Apr 27, 2015 7:46 am

Post by OSWorX » Mon May 07, 2018 3:57 am

Simply call like:

Code: Select all

$data['product_total'] = $this->load->controller( 'controller/prodcut/category/FUNCTION_HERE' );
Where it could be that, you have to hand over an array to this function - if this function require one.

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


User avatar
Guru Member

Posts

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

Users browsing this forum: No registered users and 22 guests