![]() |
Adding Featured Products to a Static Page
I am trying to add the Featured Products to one of my static pages. I tried copying the line in welcome.tpl that displays the featured products:
Code:
{include file="customer/main/featured.tpl" f_products=$f_products} When I tried that, it displayed the Featured Products title, but instead of products, it displayed a message: There are no available featured products... I assume the variable $f_products was empty. How can I display the Featured Products on a static page? Any tips? |
Not sure if it is easily doable, as the featured products are built into the products templates, not the static page templates.
|
Re: Adding Featured Products to a Static Page
Here is a quick way to do it
Modify pages.php: Code:
require "./auth.php"; and then in your static page, insert: Code:
{include file="customer/main/featured.tpl" f_products=$f_products} and be sure you have "Parse Smarty tags in the content of embedded pages" checked in the admin site. |
Re: Adding Featured Products to a Static Page
Or you can use our featured product manager for complete control of you static pages and front page
http://www.firetanksoftware.com/fts/customer/Featured-Product-Manager-for-x-cart-pid-146.html |
Re: Adding Featured Products to a Static Page
Quote:
but one more thing.. how can i separate the feature products by the POS number so i can make separate groups of featured products? for example; the feature products on the homepage will have the POS numbers 1-10. the feature products on the static page will have the POS numbers 11-20. i've done this before with my categories menu..just dont know how to input it for my feature products. any help would be great appreciated. |
Re: Adding Featured Products to a Static Page
..bump..
|
Re: Adding Featured Products to a Static Page
I'm trying to do this on a 4.3 site.
They wanted a handful of static pages to be used as SEM landing pages, with featured products for a non-display category. So I've rigged the sidemenu to not display certain categories with pos > 800. Then created the category and featured products. So far my static page contains: Code:
{php} But how do I pass the category parameter to the module? I also seem to be getting fatal errors when the included php module performs the smarty assign statement. Fatal error: Call to a member function assign() on a non-object in /var/www/devwww.aimbooks.com.au/include/categories.php on line 52 |
Re: Adding Featured Products to a Static Page
Quote:
The best way I found to do this method so far is to write conditional if statement in the pages.php file similar to the following: Code:
if ($pageid == '10') { $cat="103"; }; Hope this helps Darren |
Re: Adding Featured Products to a Static Page
Quote:
details,pls? |
Re: Adding Featured Products to a Static Page
Quote:
In the file /pages.php, at the top, after this line: Code:
require $xcart_dir."/include/categories.php"; I have put: Code:
if ($pageid == '15') { $cat="104"; }; This means that if the Page ID (seen when you edit the page in the URL of the admin area) matches the $pageid variable, then it sets the category of the featured products to (in this case) Category 104. So when you edit a static page, you need to insert this code into the body: Code:
{include file=customer/main/featured.tpl f_products=$f_products} Note: make sure you have selected the option "Parse Smarty tags in the content of embedded pages" in the Pages section. This should now include the featured products from a particular category (the 104 ID) and include them in the specific page (with the Page ID 15). If you still need help just reply in here. |
All times are GMT -8. The time now is 11:43 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.