Jump to content

Including Prestashop Modules into HTML documents


Recommended Posts

I have a page that uses a static HTML page as the index page. As you go further into my site, you can reach the Prestashop store, here's my problem however:

I'd like to be able to use some of my prestashop modules elsewhere in my site besides just the PHP pages.

 

For example, on my index page, I want to include the "viewed products" module (/modules/blockviewed/blockviewed.php), but like I mentioned, my index page isn't part of my prestashop store.

 

How could I call for a specific module within the store and include it in my html pages? I'm familiar with coding and I've put together some of my own simple prestashop templates, so I can understand a PHP or HTML coding solution, I just can't figure out this include.

 

Thanks in advance for any help.

Link to comment
Share on other sites

It's more complex than that, too complex to simply use a static CMS page as my index page unfortunately :(

 

What I'm hoping to find is a simple include command, similar to HTML's <!--#include virtual="SOMEPAGE.html"-->, but I know that it's probably more complex than that.

Link to comment
Share on other sites

Hi,

 

Please take note that prestashop uses the MVC structure

[ex. root file (.php) -> Controller (.php) -> html template (.tpl)]

 

If you want to insert an html file in your template, make sure to add it in your theme directory together with the other .tpl files.

 

I usually insert them in 2 ways:

1) if it's something that needs to be processed before the actual .tpl file is called, I try to include my custom file in either of these functions (preProcess, process, displayContent) in the Controller:

 

self::$smarty->display(_PS_THEME_DIR_.'order-payment.tpl');

 

2) if it's somewhere inside some div in the product.tpl file for example, I include my custom html file like this:

 

{include file="$tpl_dir./product-list.tpl" products=$packItems}

 

Hope that helps ^_^

 

Shy2

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...