X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Adding Featured Products to a Static Page (https://forum.x-cart.com/showthread.php?t=20839)

gannawdm 03-30-2006 02:32 PM

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?

balinor 03-30-2006 03:54 PM

Not sure if it is easily doable, as the featured products are built into the products templates, not the static page templates.

skipmartin 01-29-2007 12:36 PM

Re: Adding Featured Products to a Static Page
 
Here is a quick way to do it

Modify pages.php:
Code:

require "./auth.php";
require $xcart_dir."/include/categories.php";
include "./featured_products.php";  // ADD THIS LINE

x_load('files');


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.

groovico 02-05-2007 04:44 PM

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

More-Japan 12-18-2007 08:48 AM

Re: Adding Featured Products to a Static Page
 
Quote:

Originally Posted by skipmartin
Here is a quick way to do it

Modify pages.php:
Code:

require "./auth.php";
require $xcart_dir."/include/categories.php";
include "./featured_products.php";  // ADD THIS LINE

x_load('files');


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.

This is exactly what i was looking for!..

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.

More-Japan 01-31-2008 12:53 PM

Re: Adding Featured Products to a Static Page
 
..bump..

ozchris 12-21-2010 05:09 PM

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}
$cat=10;
include "./include/categories.php";
include "./featured_products.php";
{/php}
{include file="customer/main/featured.tpl" f_products=$f_products}



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



dmpinder 06-01-2011 05:54 AM

Re: Adding Featured Products to a Static Page
 
Quote:

But how do I pass the category parameter to the module?

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"; };
include './featured_products.php';


Hope this helps

Darren

Eyeglasses Expert 10-03-2011 07:36 AM

Re: Adding Featured Products to a Static Page
 
Quote:

Originally Posted by dmpinder
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"; };
include './featured_products.php';


Hope this helps

Darren


details,pls?

dmpinder 10-04-2011 01:45 AM

Re: Adding Featured Products to a Static Page
 
Quote:

Originally Posted by Eyeglasses Expert
details,pls?


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"; };
include './featured_products.php';


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.