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

Cats into Featured?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-02-2007, 02:35 AM
 
denisg denisg is offline
 

Advanced Member
  
Join Date: Jan 2006
Posts: 44
 

Default Cats into Featured?

Seems a number of folks would like to have a categories section on the front page similar to the featured products. Searching would suggest no answers. As this works with individual products, is there a way of coding to add cat's to the featured prod's as an alternative way?

If you're watching Xcart, it is a feature that should be included

Denis.
__________________
DenisG
V4.0.14
www.mercersfurniture.co.uk
V4.1.11
www.mattress4beds.co.uk/home.php/"
Reply With Quote
  #2  
Old 07-02-2007, 11:26 PM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default Re: Cats into Featured?

in skin1/customer/main/welcome.tpl,
before the featured_products.tpl include,
add
Code:
{include file="customer/main/categories_welcome.tpl"} <br />

create a new file called categories_welcome.tpl in skin1/customer/main
with (change number of columns accordingly)
Code:
{capture name=dialog} <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td> <table width="100%" cellpadding="5" cellspacing="1"> <tr> {assign var="width" value=20} {foreach from=$categories item=ca name=cats} {if $smarty.foreach.cats.index is div by 4} </tr> <tr> {/if} <td width="{$width}%" class="PListCell"> <div> <a href="home.php?cat={$ca.categoryid}" class="VertMenuItems"><img src="{if $current_category.icon_url}{$current_category.icon_url}{else}{$xcart_web_dir}/image.php?id={$ca.categoryid}&amp;type=C{/if}" /></a> </div> <div> <font class="CategoriesList"><a href="home.php?cat={$ca.categoryid}" class="VertMenuItems">{$ca.category}</a></font><br /> </div> </td> {/foreach} </table> </td> </tr> </table> {/capture} {include file="dialog.tpl" title=$lng.lbl_categories content=$smarty.capture.dialog extra='width="100%"'}

it may contain a few bugs (i found one where if you have category images displayed on the side menu they will all display the same icon once you click on a category), but it should get you started


a sample image of it can be found in the attached thumbnail
Attached Thumbnails
Click image for larger version

Name:	sample.jpg
Views:	445
Size:	61.8 KB
ID:	446  
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote
  #3  
Old 07-04-2007, 01:14 AM
 
denisg denisg is offline
 

Advanced Member
  
Join Date: Jan 2006
Posts: 44
 

Default Re: Cats into Featured?

You are a star sir. Many thanks

Exactly as we wanted it except I can get only my modified default icon for "no picture". I modded this to 1px sqr so that with a border of 1px it looked like a "bullet". This is all that is showing although everything else works a treat. All the cat's have picture icons. See http://www.mercersfurniture.co.uk/home.php to see what I mean. I have read the code over and over and tried various things but nothing I have changed, except the column numbers, has brought up the icons , any ideas?

Again, many thanks.

Denis.
__________________
DenisG
V4.0.14
www.mercersfurniture.co.uk
V4.1.11
www.mattress4beds.co.uk/home.php/"
Reply With Quote
  #4  
Old 07-04-2007, 02:04 AM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default Re: Cats into Featured?

if you dont want the images, remove
Code:
<div> <a href="home.php?cat={$ca.categoryid}" class="VertMenuItems"><img src="{if $current_category.icon_url}{$current_category.icon_url}{else}{$xcart_web_dir}/image.php?id={$ca.categoryid}&amp;type=C{/if}" /></a> </div>
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote
  #5  
Old 07-04-2007, 03:41 AM
 
denisg denisg is offline
 

Advanced Member
  
Join Date: Jan 2006
Posts: 44
 

Default Re: Cats into Featured?

Sorry, I do want the actual category icons, the photographs, which as I read the code it should produce, but I am not getting these. Basically, I want it to look just like the featured products. The actual category icons have always been a bugbear to me as they never seem to show anywhere unless you actually click on the Category itself although they are set to show elsewhere too. Maybe a connection here, I don't know?

Showing the actual category icons really would be super.

Sorry if I misled you there

Denis.
__________________
DenisG
V4.0.14
www.mercersfurniture.co.uk
V4.1.11
www.mattress4beds.co.uk/home.php/"
Reply With Quote
  #6  
Old 07-04-2007, 04:20 AM
 
denisg denisg is offline
 

Advanced Member
  
Join Date: Jan 2006
Posts: 44
 

Default Re: Cats into Featured?

Strange , if I add some gobbledegook (**!) to the front of your <img src=> part of the code so I can see the image ref on shop front, it shows:


<**!img src="/image.php?id=375&type=C" />
PINETUM Furniture

The actual icon for this cat (info via properties) is "/icon.php?categoryid=375&rand=2132004131"

"PINETUM Furniture" is the Cat title.

Does this sound right?

Denis.
__________________
DenisG
V4.0.14
www.mercersfurniture.co.uk
V4.1.11
www.mattress4beds.co.uk/home.php/"
Reply With Quote
  #7  
Old 07-05-2007, 02:37 AM
 
Sinderella Sinderella is offline
 

Newbie
  
Join Date: Sep 2006
Posts: 7
 

Default Re: Cats into Featured?

inebriate, I can't thank you enough for this!!!!!!!!!!!!!!!!!

I'm not finished playing with the category images yet, but just putting the code in seems to be exactly what I've been looking for.
__________________
Gold 4.1.3
Reply With Quote
  #8  
Old 02-22-2008, 08:41 AM
 
toolexperts toolexperts is offline
 

eXpert
  
Join Date: Feb 2008
Location: Knoxville, TN
Posts: 290
 

Default Re: Cats into Featured?

how do i make the category name and number of products in department show?
__________________
Tool Experts
X-Cart DB Version: 5.4.1.49
Windows
Reply With Quote
  #9  
Old 02-22-2008, 11:00 AM
 
toolexperts toolexperts is offline
 

eXpert
  
Join Date: Feb 2008
Location: Knoxville, TN
Posts: 290
 

Default Re: Cats into Featured?

i have the images set pretty much the way I want. However the links are invisible then turn red...I assume I can fix this in CSS right?
__________________
Tool Experts
X-Cart DB Version: 5.4.1.49
Windows
Reply With Quote
  #10  
Old 02-25-2008, 06:15 AM
 
toolexperts toolexperts is offline
 

eXpert
  
Join Date: Feb 2008
Location: Knoxville, TN
Posts: 290
 

Default Re: Cats into Featured?

Ok I am looking through my css...and I cannot locate the code that would operate changing the text in the categories welcome section from white to red
__________________
Tool Experts
X-Cart DB Version: 5.4.1.49
Windows
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:29 AM.

   

 
X-Cart forums © 2001-2020