Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Adding Featured Products to a Static Page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-30-2006, 02:32 PM
  gannawdm's Avatar 
gannawdm gannawdm is offline
 

Member
  
Join Date: Jan 2006
Posts: 24
 

Default 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?
__________________
Forgetmenotjewelry.com
Fine sapphire jewelry with a romantic message.

x-cart 4.0.17 gold
Reply With Quote
  #2  
Old 03-30-2006, 03:54 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Not sure if it is easily doable, as the featured products are built into the products templates, not the static page templates.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 01-29-2007, 12:36 PM
 
skipmartin skipmartin is offline
 

Advanced Member
  
Join Date: Oct 2003
Posts: 30
 

Default 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.
__________________
Andy Melichar, Tech Director - REBEL INTERACTIVE -
andy@rebel-interactive.com - X-Cart version 4.1.3
Reply With Quote
  #4  
Old 02-05-2007, 04:44 PM
  groovico's Avatar 
groovico groovico is offline
 

X-Man
  
Join Date: Apr 2003
Location: Firetanksoftware.com
Posts: 2,326
 

Default 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
__________________
Groovico

Used by X-carters the world over:
Marketing Manager Pro Bundle For X-cart
Featured Product Manager for X-cart
Feed manager pro for X-cart

http://www.firetanksoftware.com

Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X
Reply With Quote
  #5  
Old 12-18-2007, 08:48 AM
  More-Japan's Avatar 
More-Japan More-Japan is offline
 

Senior Member
  
Join Date: Jan 2005
Posts: 107
 

Default 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.
__________________
Version 5.2.13

http://www.more-japan.com/
Reply With Quote
  #6  
Old 01-31-2008, 12:53 PM
  More-Japan's Avatar 
More-Japan More-Japan is offline
 

Senior Member
  
Join Date: Jan 2005
Posts: 107
 

Default Re: Adding Featured Products to a Static Page

..bump..
__________________
Version 5.2.13

http://www.more-japan.com/
Reply With Quote
  #7  
Old 12-21-2010, 05:09 PM
 
ozchris ozchris is offline
 

Senior Member
  
Join Date: Jun 2007
Posts: 100
 

Default 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


__________________
Linux. Apache. PHP 5.2
Site 1 - now xcart 4.4.1 DSEFU, AOM, RMA, Magnifier, Upsells. Heavy mods for Australian postcode validation and extra Aussie payment method.
Site 2 - xcart 4.1.11, DSEFU
Site 3 - xcart 4.2
Site 4 - xcart 4.3
Reply With Quote
  #8  
Old 06-01-2011, 05:54 AM
 
dmpinder dmpinder is offline
 

Advanced Member
  
Join Date: Jun 2009
Posts: 86
 

Default 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
__________________
Darren

X-Cart Gold 4.3.1
Reply With Quote
  #9  
Old 10-03-2011, 07:36 AM
 
Eyeglasses Expert Eyeglasses Expert is offline
 

eXpert
  
Join Date: May 2010
Posts: 306
 

Default 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?
Reply With Quote
  #10  
Old 10-04-2011, 01:45 AM
 
dmpinder dmpinder is offline
 

Advanced Member
  
Join Date: Jun 2009
Posts: 86
 

Wink 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.
__________________
Darren

X-Cart Gold 4.3.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:05 PM.

   

 
X-Cart forums © 2001-2020