Post by malikmudassar » Mon Feb 05, 2018 6:49 am

I am using Opencart 2.2

On landing page of my store I have to show featured products of multiple categories , So i have created 4 featured extensions, assigned them products, enabled them, put them on my page form Design->layout->home and it works perfect. But now I have to render Category name in every featured.tpl . The $heading_title variable gets its value from language which is always the word featured. I want to display extension name in the view, how can i get extension name in featured controller or featured.tpl

Any help?

Newbie

Posts

Joined
Mon Feb 05, 2018 6:41 am

Post by IP_CAM » Thu Feb 08, 2018 1:32 pm

Did you really change all FEATURED - related values correctly, in each one
of the files, related to such an Extension?
The Files have to be named, by example:
featured.php/or/.tpl - featured2.php/or/.tpl - featured3.php/or/.tpl - e.t.c.
and the corresponding 'internal linking' in the files has to 'match' with it's MASTER :D
And it will also require some DB-Entries, in the Extension Section, I assume:
table=oc_extension&topTabSet=2 (see image below !)
---
Ernie
---
Content out of a catalog/controller/module/featured.php file: ( OC v.1.5.6.x !)

Code: Select all

<?php
class ControllerModuleFeatured extends Controller {
protected function index($setting) {

$this->data['change'] = $change['featured'];

$this->data['description_status'] = $change['featured']['desc_status'];

$this->data['max'] = $change['featured']['css_strlen'];

$this->data['title_length'] = $change['featured']['css_productname'];

$this->data['tax_status'] = $change['featured']['tax_status'];

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/featured.tpl')) {
$this->template = $this->config->get('config_template') . '/template/module/featured.tpl';
} else {
$this->template = 'default/template/module/featured.tpl';
Content out of a catalog/controller/module/featured2.php file: (UNTESTED!!

Code: Select all

<?php
class ControllerModuleFeatured2 extends Controller {
protected function index($setting) {

$this->data['change'] = $change['featured2'];

$this->data['description_status'] = $change['featured2']['desc_status'];

$this->data['max'] = $change['featured2']['css_strlen'];

$this->data['title_length'] = $change['featured2']['css_productname'];

$this->data['tax_status'] = $change['featured2']['tax_status'];

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/featured2.tpl')) {
$this->template = $this->config->get('config_template') . '/template/module/featured2.tpl';
} else {
$this->template = 'default/template/module/featured2.tpl';
---
Image

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

User avatar
Active Member

Posts

Joined
Fri Mar 16, 2012 10:18 am
Location - Canada, QC
Who is online

Users browsing this forum: No registered users and 60 guests