Page 1 of 1

is every category or product have a code?[Solved]

Posted: Wed Oct 19, 2011 8:59 pm
by kingsbathroom
Hello friends:

I want to know whether there is individual code page for every product or category, which directory is in?

Thank you in advance

Tina

Re: is every category or product have a code?

Posted: Wed Oct 19, 2011 9:19 pm
by uksitebuilder
Hi Tina,

Sorry I dont quite understand your question. Could you explain a little more on what you are trying to do.

Re: is every category or product have a code?

Posted: Wed Oct 19, 2011 9:33 pm
by kingsbathroom
Hi Simon:

I would like to change every category individual using html or php code, I think the code of the every category or product might be stored in some directory in ftp. so do u know any information about it.

For example, if i have 5 different categories, I wound like they have different looking. I think i need to it individually. Hope you can understand me this time.

Thank you
Tina

Re: is every category or product have a code?

Posted: Wed Oct 19, 2011 9:37 pm
by uksitebuilder
Hi Tina,

All data is stored in the database and fetched depending on the link clicked which holds the id for that category. This is then served via a template for the category.

Not something that is going to be easily editable to have a different template for each category.

There may be an extension to do this in the extension store though.

Re: is every category or product have a code?

Posted: Wed Oct 19, 2011 9:37 pm
by Xsecrets
That is not possible at this time. There is no separate code they all use the same php files.

Re: is every category or product have a code?

Posted: Wed Oct 19, 2011 9:46 pm
by kingsbathroom
do you mean they have to be the same theme, I can change the whole theme and i can not change them individually? like home page, where is the code file stored in ftp which is the same code when you open the website to view the source, normally it is index.html or index.php. but i can not find in our ftp.

sorry for all those silly questions.

Thank you
Tina

Re: is every category or product have a code?

Posted: Wed Oct 19, 2011 9:58 pm
by uksitebuilder
Xsecrets wrote:That is not possible at this time. There is no separate code they all use the same php files.
Isn't this the sort of thing http://www.opencart.com/index.php?route ... on_id=2359

Re: is every category or product have a code?

Posted: Wed Oct 19, 2011 10:03 pm
by kingsbathroom
Hi simon:

It is similar idea, but i prefer to code my category individually. do you know where can i find the source code for it?

Thank you
Tina

Re: is every category or product have a code?

Posted: Wed Oct 19, 2011 10:10 pm
by uksitebuilder
It is going to be a little tricky because OpenCart uses MVC+L so you should ideally know the how MVC+L works and I have a feeling this will be new to you.

Doing it yourself, you will only be able to edit the single template which all categories will display.

Files for the category page can be found in the following locations

catalog/view/theme/default/template/product/category.tpl
catalog/controller/product/category.php
catalog/language/english/product/category.php
catalog/model/product/category.php

Basically MVC+L works a little like this

the template file gets it's data from the controller file
the controller file gets it's data from both the language file(s) and the model file
the model file gets it's data from the database

in addition both all files can use globally available data such as get and post requests plus any config data stored in the settings table of the database (plus a few other locations/methods)

Re: is every category or product have a code?

Posted: Wed Oct 19, 2011 10:14 pm
by kingsbathroom
Hi Simon:

Thank you for your reply, I am really appreciate it. I think i got the general idea how it works.

Tina