Jump to content

logic structure


Recommended Posts

I'm trying to get my head around the logic structure of Prestashop. I need to modify some things and it is quite difficult to navigate through so many folders and so many php and tpl files.

Is there a guide that gives an overview of the structure? I can't find anything on the website.

The specific thing I want to do at the moment is to integrate it with my existing website. I want to keep my existing header and navigation, but have the shop function within a container of one of my pages. is there a key file that I should be looking at to bring into the appropriate container using an include tag?
example: <?php include("prestashop/filename.php")?>

Link to comment
Share on other sites

thanks. I've found that the header.tpl and footer.tpl files (located under theme folder) contain the start and finish of the html code that will be generated into a page.

I've tried adding my code to these files.

It's not easy to integrate for a couple of reasons.

One is that some of the layout and background graphics are specified in CSS. It conflicts with the Prestashop template (header block overlaps my website header/backgorund). I should be able to sort this out by working through the CSS (which I'm not looking forward to).

The other problem is my drop down menu for site navigation. Due to some of the effects I wanted, I had to do some hacks to make it work properly under IE. The hacks require it to be positioned above all other elements. I bring the navigation content it in with an "include" tag. It has disappeared.

I Will keep plugging away, but if anyone else has a suggestion, please tell me.

Link to comment
Share on other sites

I managed to solve it. I think my experience may help other people to get a handle on how to work with this type of software.

After much frustration, I have found the key files are the header.php and the footer.php. They generate the start and ending of the html code by bringing in the data from tpl files. Knowing that, everything else falls into place. I know this may be obvious to experienced people here, but I'm not familiar with PHP or templates and it isn't actually explained anyway I could find.

To solve my requirement to incorporate the shopping facility into my website, I placed some of my html code into the current template file called header.tpl (located under theme). By looking though this file, you can also see where to place the links to CSS and any external script files. I placed a DIV container to hold the entire shop. The closing tag for this div goes at the end of the footer.tpl

Be aware of CSS conflicts. I had some duplicated names so I ended up pasting in some of my CSS into the global.CSS file and changing a couple of identity names.

Also found out that you can't have a "PHP include" within a TPL file. It doesn't work. I had to place that tag into the footer.php file instead of the template (tpl) file.

After several hours of trial and error, it might be messy but it works. (but not live yet)
It even works in IE6 which had always been my nemesis.

Link to comment
Share on other sites

×
×
  • Create New...