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)
-   -   Homepage show cat in welcome area (https://forum.x-cart.com/showthread.php?t=24758)

hudge 09-08-2006 10:59 AM

Homepage show cat in welcome area
 
How do I add the main cat to the home page similar to lite commerce does:
http://www.litecommerce.com/demo/cart.php

Thanks

balinor 09-20-2006 03:00 AM

Re: Homepage show cat in welcome area
 
Put this in customer/man/welcome.tpl:

{include file="customer/main/subcategories.tpl" cat=$cat}

Alltribes 09-20-2006 07:40 AM

Re: Homepage show cat in welcome area
 
That won't quite do it balinor. That just shows them in a single column. Try this:

Code:

{if $subcategories}
<table cellspacing="5" width="100%" border="0">
<tr>
{foreach from=$subcategories item=subcat}

{if $tmp is div by 4}
    </tr><tr><td colspan="3"></td></tr><tr valign="top">
{/if}

{ if $tmp and $first_subcat ne "Y" }
    {assign var="tmp" value=1}
    {assign var="first_subcat" value="Y"}
{/if}

 <td class="ColumnTitles" valign="top"><a title="{$subcat.category}" href="home.php?cat={ $subcat.categoryid }"><img src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_web_dir}/default_image.gif{/if}" alt="" />

    <br /><font class="ItemsList">{ $subcat.category|escape }</font></a>

    {if $config.Appearance.count_products eq "Y"}
{if $subcat.product_count}{ $subcat.product_count } {$lng.lbl_products}
{elseif $subcat.subcategory_count}{ $subcat.subcategory_count } {$lng.lbl_categories|lower}
{else} 0 Products
{/if}
    {/if}
{assign var="tmp" value=$tmp+1}
{/foreach}
</table>
{/if}


Change {if $tmp is div by 4} to whatever number of columns you want.

balinor 09-20-2006 07:42 AM

Re: Homepage show cat in welcome area
 
Sorry, forgot subcategories come in that crappy list by default...I have them in columns by default in my install package.

hudge 09-20-2006 09:31 AM

Re: Homepage show cat in welcome area
 
THANKS! This helps might site alot.

Anyway of autosizing to 100x100px of the icons via thumb.phplike the products?

Alltribes 09-20-2006 10:02 AM

Re: Homepage show cat in welcome area
 
I'm still working on that. I just implimented the code yesterday.

One change I have made since posting though is to change {if $tmp is div by 4} to {if $tmp is div by $config.Appearance.products_per_row}

I'll be adding the code for thumbnail sizing next. I'll let you know when I've got it working.


All times are GMT -8. The time now is 04:58 AM.

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