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

Featured products on home page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-13-2012, 07:58 AM
 
Nolimits Nolimits is offline
 

Member
  
Join Date: Mar 2012
Posts: 17
 

Default Featured products on home page

Hi,

can anybody help me with the problem I've trying to solve for 2 weeks.
I need to show featured products from 3 different categories on the front page.

I know that if I use
Code:
{capture name=dialog} { include file="customer/main/products.tpl" products=$f_products featured="Y" } {/capture} { include file="customer/dialog.tpl" title=$lng.lbl_featured_products content=$smarty.capture.dialog sort=true additional_class="products-dialog dialog-featured-list" }

this will show featured products on the home page but not from specific category.
But my task is to show featured products from specific category :/

Please help - I'm stuck on this for a very long time.

Thx in advance!
__________________
4.4.4
Reply With Quote
  #2  
Old 04-13-2012, 08:30 AM
  Toora Designs's Avatar 
Toora Designs Toora Designs is offline
 

eXpert
  
Join Date: Aug 2011
Location: California USA
Posts: 281
 

Default Re: Featured products on home page

You can mange featured products from XC backend under categories. When you scroll down to the bottom you will see "Featured products"

For more info... http://help.x-cart.com/index.php?title=X-Cart:Featured_Products
__________________
If you need professional help on your x-cart site or any website.
Feel free to PM me or Skype me to discuss your project.
Reply With Quote
  #3  
Old 04-13-2012, 08:45 AM
 
Nolimits Nolimits is offline
 

Member
  
Join Date: Mar 2012
Posts: 17
 

Default Re: Featured products on home page

Thx for reply but I don't think you understood my problem.
I know I can add (general )featured products on the home page.

But I need featured products from specific categories.
So if I go to the "Catalog->Categories", select desired category, scroll to the bottom of the page and add "Featured product" - how can I add this product to the home page (along with other featured products from other categories)?

Or I can ask this question differently...
How can I define featured products category in this import
Code:
{capture name=dialog} {include file="customer/main/products.tpl" products=$f_products featured="Y"} {/capture} {include file="customer/dialog.tpl" title=$lng.lbl_featured_products content=$smarty.capture.dialog sort=true additional_class="products-dialog dialog-featured-list"}

It is evident that
Code:
{include file="customer/main/products.tpl" products=$f_products featured="Y"}

imports featured products to the page (home, or any other) - but category ID of these featured products is "0" and I need it to be specific ID(s)

So is it somehow possible to add some category property into this import?
Something like
Code:
{include file="customer/main/products.tpl" cat=123 products=$f_products featured="Y"}

or something similar?

Thx in advance!
__________________
4.4.4
Reply With Quote
  #4  
Old 04-13-2012, 09:01 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Featured products on home page

Quote:
Originally Posted by Nolimits
But I need featured products from specific categories.
So if I go to the "Catalog->Categories", select desired category, scroll to the bottom of the page and add "Featured product" - how can I add this product to the home page (along with other featured products from other categories)?

You don't go to specific category - stay at the root and add feature products from whichever category you want. They will show on front page only
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 04-13-2012, 09:07 AM
 
Nolimits Nolimits is offline
 

Member
  
Join Date: Mar 2012
Posts: 17
 

Default Re: Featured products on home page

I know that, but what if want (and I want ) to distinguish featured products by category?
So I need (for example) 3 imports like this:
Code:
{include file="customer/main/products.tpl" products=$f_products featured="Y"}

In case I add products in category id == "0" (featured products with no category) I'll get 3 exact the same results. And I don't want that :/

Thx!
__________________
4.4.4
Reply With Quote
  #6  
Old 04-13-2012, 09:07 AM
  Toora Designs's Avatar 
Toora Designs Toora Designs is offline
 

eXpert
  
Join Date: Aug 2011
Location: California USA
Posts: 281
 

Default Re: Featured products on home page

Yup Steve is right
refer to this page http://help.x-cart.com/index.php?title=X-Cart:Featured_Products#Adding_Featured_Products
__________________
If you need professional help on your x-cart site or any website.
Feel free to PM me or Skype me to discuss your project.
Reply With Quote
  #7  
Old 04-13-2012, 09:13 AM
 
Nolimits Nolimits is offline
 

Member
  
Join Date: Mar 2012
Posts: 17
 

Default Re: Featured products on home page

Sorry for the confusion.

What I need is to have three separate instances of the
{ include file="customer/main/products.tpl" products=$f_products featured="Y" }
On our home page, each instance will list the featured products from a different category.


The question is:

1. How can I declare which category the featured products are pulled from?
2. How can I have 3 separate instance of the featured products, pull from different categories.

Thx!
__________________
4.4.4
Reply With Quote
  #8  
Old 04-13-2012, 09:22 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Featured products on home page

You can add all products you want and set pos field then use an if/else statement for which products to show on which instance based on pos field numbers
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #9  
Old 04-13-2012, 09:59 AM
 
Nolimits Nolimits is offline
 

Member
  
Join Date: Mar 2012
Posts: 17
 

Default Re: Featured products on home page

I guess the Q i have is what would be the "if/else statement for which products to show on which instance " can you provide an example?

Thx so much. Help is appreciated.


Quote:
Originally Posted by cflsystems
You can add all products you want and set pos field then use an if/else statement for which products to show on which instance based on pos field numbers
__________________
4.4.4
Reply With Quote
  #10  
Old 04-17-2012, 04:30 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Featured products on home page

You can't do this in templates alone. $f_products is only for the current category or home page. You would have to get into the php to do some queries to get the featured products defined in those categories.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
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 05:44 AM.

   

 
X-Cart forums © 2001-2020