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)
-   -   Cats into Featured? (https://forum.x-cart.com/showthread.php?t=32237)

denisg 07-02-2007 02:35 AM

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:wink: :-)

Denis.

inebriate 07-02-2007 11:26 PM

Re: Cats into Featured?
 
1 Attachment(s)
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

denisg 07-04-2007 01:14 AM

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.

inebriate 07-04-2007 02:04 AM

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>


denisg 07-04-2007 03:41 AM

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:oops:

Denis.

denisg 07-04-2007 04:20 AM

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.

Sinderella 07-05-2007 02:37 AM

Re: Cats into Featured?
 
inebriate, I can't thank you enough for this!!!!!!!!!!!!!!!!!:D/

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.

toolexperts 02-22-2008 08:41 AM

Re: Cats into Featured?
 
how do i make the category name and number of products in department show?

toolexperts 02-22-2008 11:00 AM

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?

toolexperts 02-25-2008 06:15 AM

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


All times are GMT -8. The time now is 10:29 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.