Post by andric2k » Mon Apr 20, 2009 1:52 pm

Hi,

May I know do we need to put any configuration code in the system when I want to add new module or move module from one place to another place?

I always hit error when I want to add in new module. For E.g: in open cart 1.2.6, I would like to move the search module in header.tpl to layout.tpl column_right but I hit error of "Undefined variable: search in". This will not happen in 1.2.5. Can anyone give me some idea whether I have miss out any part in the configuration or coding.

Thanks in advanced.

New member

Posts

Joined
Thu Mar 05, 2009 5:19 pm

Post by fido-x » Mon Apr 20, 2009 5:36 pm

If you want to put the "search" module in the column, these instructions should help.

Edit "catalog/controller/common/header.php" (lines 26-29), change from:

Code: Select all

$this->children = array(
	'common/language',
	'common/search'
);
to:

Code: Select all

$this->children = array(
	'common/language',
//	'common/search'
);
Edit "catalog/controller/common/layout.php" (lines 16-19), change from:

Code: Select all

$this->children = array(
	'common/header',
	'common/footer'
);
to:

Code: Select all

$this->children = array(
	'common/header',
	'common/footer',
	'common/search'
);
Edit "catalog/view/theme/default/template/common/header.tpl" (in line 3), change:

Code: Select all

<?php echo $search; ?>
to:

Code: Select all

<?php //echo $search; ?>
or:

Code: Select all

<?php echo @$search; ?>
Edit "catalog/view/theme/default/template/common/layout.tpl", insert

Code: Select all

<?php echo @$search; ?>
below

Code: Select all

<div id="column_right">
Edit "catalog/view/theme/default/template/common/search.tpl" accordingly (or not).

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by andric2k » Mon Apr 20, 2009 5:45 pm

thanks a lot. It solve my problem.

However, do you know the solution that we need to insert data into extension and setting table.
After the table insertion, we need to create search.tpl in module folder?

I tried that, but I failed. It shows cannot not load the search module.


Thanks.

New member

Posts

Joined
Thu Mar 05, 2009 5:19 pm

Post by fido-x » Mon Apr 20, 2009 6:00 pm

The search.tpl file is now in the "catalog/view/theme/default/template/common" directory.
The search "module" doesn't have any administrative components, so it is not configurable from the administration.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by andric2k » Mon Apr 20, 2009 11:14 pm

hi fido-x,

How can I make search.tpl as an administrative component? And why search.tpl file in the "catalog/view/theme/default/template/common" directory does not have administrative component? Can you teach me or tell me in detail.

Thanks.

New member

Posts

Joined
Thu Mar 05, 2009 5:19 pm

Post by fido-x » Tue Apr 21, 2009 7:36 pm

Version 1.2.6 re-introduced the module system that Daniel had used in 0.7.7 (continued in OpenCart Zero) and expanded upon it to provide some dynamics in the way modules are handled. This resulted in a re-arrangement of the directory structure. As a consequence, some page elements that we might consider to be "modules" (ie. header, footer, language & search) were made to be "static" elements of the page - that is, they are not intended to be moved (it would be a bit ridiculous to move the header to some other position).

Enabling the "dynamics" of the module system requires that the modules have some administrative component. Since only the modules in the column were intended to be moved, it is only these modules that have administrative components.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by andric2k » Wed Apr 22, 2009 11:44 am

Hi,

How can I make the page/component have administrator right. I believe if we simply move those page/tpl around or some other module will cause error "Could not load module!".
Please kindly tell me more cause I really want to understand how all of this work around.
Eg: put special offer (catalog\view\theme\default\template\product) into home.tpl.


Thanks and Regrads,
Andric Ng

New member

Posts

Joined
Thu Mar 05, 2009 5:19 pm

Post by phpuk » Thu Apr 23, 2009 9:17 am

Hi,

The solution to this for version 1.2.6 is here http://forum.opencart.com/viewtopic.php ... 275#p18275

Phil.

Global Moderator

Posts

Joined
Wed Mar 25, 2009 10:57 am

Post by delite163 » Sat Apr 25, 2009 2:30 am

Hi
Thanks for the mod and I was able to move the search to the right but it ended up on the bottom of the page ;0) What did I do wrong?
thank you

New member

Posts

Joined
Fri Apr 03, 2009 12:40 pm

Post by delite163 » Sat Apr 25, 2009 4:27 am

delite163 wrote:Hi
Thanks for the mod and I was able to move the search to the right but it ended up on the bottom of the page ;0) What did I do wrong?
thank you
Ok Got the search box moved where I want it .

New member

Posts

Joined
Fri Apr 03, 2009 12:40 pm

Post by phpuk » Sat Apr 25, 2009 4:38 am

Hi,

Did you fix it by altering the sort order or was there another problem?
Just want to know if my instruction for the module are correct.

Phil.

Global Moderator

Posts

Joined
Wed Mar 25, 2009 10:57 am

Post by delite163 » Sat Apr 25, 2009 7:31 am

phpuk wrote:Hi,

Did you fix it by altering the sort order or was there another problem?
Just want to know if my instruction for the module are correct.

Phil.
Hi Phil,
It was something that I did wrong. I had the snippet <?php echo @$search; ?> at the bottom of the right column instead of adding it at the top in layout.tpl. It was after all very simple. Everything on you part was all good it was my blip up.
Delite163

New member

Posts

Joined
Fri Apr 03, 2009 12:40 pm

Post by phpuk » Sat Apr 25, 2009 10:05 am

Ok thanks for letting me know.

Phil.

Global Moderator

Posts

Joined
Wed Mar 25, 2009 10:57 am
Who is online

Users browsing this forum: No registered users and 7 guests