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

Display first 3 products from selected categories on HP

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-05-2013, 04:47 AM
 
elipsoid_cz elipsoid_cz is offline
 

Member
  
Join Date: Aug 2012
Posts: 15
 

Default Display first 3 products from selected categories on HP

Hi,
I'd like to display first 3 products form selected categories on my hompepage.

Could somebody help with the snippet I need to use in my home.tpl? Thanks.
__________________
4.5.2
Reply With Quote
  #2  
Old 05-05-2013, 08:18 AM
 
stonezafu stonezafu is offline
 

Member
  
Join Date: Dec 2012
Posts: 18
 

Default Re: Display first 3 products from selected categories on HP

I'm not entirely sure I'm understanding your question here, as it seems to concern a built-in facility within X-Cart.

From Dashboard, under Catalog >> Categories you'll find a place below the list of categories to put Featured Products of your own choosing. You can browse among your product list and add items quite straightforwardly. You can put them in any order you like by choosing the Order By number. I usually have gaps (10, 20, 30, etc) so I can shuffle home page products easily. But you can number them 1, 2, 3 if you find that easier.

If I didn't understand your question, please ask again in another way so I can get it.

Cheers, John
__________________
Two client sites: 4.4.4 and 4.5.5
Coding since 1981. Using X-Cart since 2012
Reply With Quote
  #3  
Old 05-06-2013, 02:16 AM
 
elipsoid_cz elipsoid_cz is offline
 

Member
  
Join Date: Aug 2012
Posts: 15
 

Default Re: Display first 3 products from selected categories on HP

Thank you - you are right, featured products are a partial solution. The problem is I'd like to show featured products from multiple categories (3 from each) on my homepage.

But I don't think there is a way to do this, so I thought it would be easier to show first three product from three selected categories.
__________________
4.5.2
Reply With Quote
  #4  
Old 05-06-2013, 12:19 PM
 
stonezafu stonezafu is offline
 

Member
  
Join Date: Dec 2012
Posts: 18
 

Default Re: Display first 3 products from selected categories on HP

Well, I'm not sure what limits there are in your choices - you don't say how many categories you have. On one shop I maintain (http://www.insiderchic.net/shop/) the owner has a total of 30 Featured Products selected from assorted categories. I'm sure she could have more, but there's a limit to how far people want to scroll down.

To be clear, there are two completely different types of Featured Products. One on the home page (at least in the Fashion_Mosaic_Grey template), where you can mix & match from multiple categories. The other type is on a Category page where - not surprisingly - you're restricted to products from the relevant category.

Maybe you're mixing up the two types available?

John
__________________
Two client sites: 4.4.4 and 4.5.5
Coding since 1981. Using X-Cart since 2012
Reply With Quote
  #5  
Old 05-07-2013, 12:41 AM
 
elipsoid_cz elipsoid_cz is offline
 

Member
  
Join Date: Aug 2012
Posts: 15
 

Default Re: Display first 3 products from selected categories on HP

You are right - mixing featured products from multiple categories would be possible on the homepage, but I'd like to separate them by Headings (Featured products from category A, Featured products from category B).

The reason for this is we use one category for ordering whisky tastings, while the others are for regular whisky bottles.
__________________
4.5.2
Reply With Quote
  #6  
Old 05-07-2013, 01:01 PM
 
stonezafu stonezafu is offline
 

Member
  
Join Date: Dec 2012
Posts: 18
 

Default Re: Display first 3 products from selected categories on HP

OK - I get it.

If this were simple xhtml it would be dead easy. Truth is it's a major task to unpick X-Cart's combination of html, php, Smarty templates, Javascript and MySQL reads that generates the table you're targeting. I've had a look at the source code and dug briefly into the coding behind it but I reckon it's a week's work to unravel that lot.

Maybe someone else has a better idea of how to insert a heading into each new major 'chunk' of 3 items in the table. I have identified a single non-breaking space that's used as a separator (class="separator") in the source code but I can't track down how that's generated despite a complex 'grep' search for it inside the entire X-Cart code base. I guess it's created on the fly within the Javascript itself. If you can target that you can make it show a heading line, but finding it... Yikes!

So, alternative approach, if it's any use to you - you could use WebMaster Mode to modify the value of the 'Featured Products' label [to read, say: 'Sample our fine whiskies and tastings']. We use this approach on one site to add a message about free shipping on products over a certain value. However, the same value will pop up every time you use top-level Categories, so you'd need to consider the wording carefully.

Sorry not to be more help.

Cheers, John
__________________
Two client sites: 4.4.4 and 4.5.5
Coding since 1981. Using X-Cart since 2012
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 02:34 AM.

   

 
X-Cart forums © 2001-2020