Jump to content

Duplicate featured products onto new page


Recommended Posts

Hi everyone.

I am hoping someone can help me out with a way to duplicate the featured products module onto a blank page (html or php). Basically I need to have the featured products module updated as usually directly through the system but need to have a duplicate copy of the featured products box that appears on the front page to also appear on a static page not linked to anywhere in prestashop.

the reason for this is a company we are doing some SEO work through is going to present the featured products box within an iframe in their system and we therefore need to provide the content in a non-template environment.

Anybody got any ideas?

Thank you in advance to anyone that takes a look at this for me.

Richard.

Link to comment
Share on other sites

  • 1 month later...

Thank you so much for your help, I have been able to finally get something to show but it all seems to have lost styling and showing more content than I was expecting.

I have created a duplicate of index.php and followed your guide using the following code:

<?php

include(dirname(__FILE__).'/config/config.inc.php');

if(intval(Configuration::get('PS_REWRITING_SETTINGS')) === 1)
   $rewrited_url = __PS_BASE_URI__;

include(dirname(__FILE__).'/init.php');

$smarty->assign('HOOK_HOME', Module::hookExec('home'));
$smarty->display(_PS_THEME_DIR_.'index.tpl');


?>



Using this, the normal site (which is here: http://www.directphones.com.au) stays untouched which is great but when I go to http://www.directphones.com.au/temp.php I get a jumble of the content.

I am basically only after a blank page containing the featured products block.

If it is at all possible to ask of a little more assistance, I will happily arrange for a $50us payment for your troubles.

Thank you so much for all your time so far.

Link to comment
Share on other sites

You need to remove the home hook, and only execute the featured products.

<?php

include(dirname(__FILE__).'/config/config.inc.php');

if(intval(Configuration::get('PS_REWRITING_SETTINGS')) === 1)
   $rewrited_url = __PS_BASE_URI__;

include(dirname(__FILE__).'/init.php');

echo Module::getInstanceByName('homefeatured')->hookHome();

?> 



But this won't have any css files included. If you want to have a css file applied, you need something like this:

<html>
<head>
<link rel="stylesheet" type="text/css" media="all" href="path-to-the-css-file" />
</head>
<body>
<?php

include(dirname(__FILE__).'/config/config.inc.php');

if(intval(Configuration::get('PS_REWRITING_SETTINGS')) === 1)
   $rewrited_url = __PS_BASE_URI__;

include(dirname(__FILE__).'/init.php');

echo Module::getInstanceByName('homefeatured')->hookHome();

?>
</body>
</html>

Link to comment
Share on other sites

Hey whitelighter, thank you, getting much closer now.

It is still getting a strange layout but I will have a play with this. If you have any obvious tips (try viewing http://www.directphones.com.au/temp.php) on getting it to appear more like the original featured products I'd greatly appreciate.

You've already provided me with a huge help so I'd understand if you can't spare the time for further assistance.

Again, thank you so MUCH for the help.

Link to comment
Share on other sites

Your a champion WhiteLighter, I have been sitting on this task for almost a month now and in one night you've been able to assist enormously.

When you get a chance, forward me a PayPal or Google Checkout request for $50US as I promised and I will ensure I pay you for all your troubles.

Thank you SOOOOO much.

Link to comment
Share on other sites

  • 1 month later...

Thanks for this solution, only one problem, URL is not rewritten on other pages. Displays fine on home page using friendly URL, but once inserted in other pages, products URL appear as e.g. ..../product.php?id_product=69. Any idea how to fix this? Many thanks.

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...