X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Mod for subcategories in columns with descriptions and icons (https://forum.x-cart.com/showthread.php?t=3848)

karentown 01-23-2007 12:26 AM

Re: Mod for subcategories in columns with descriptions and icons
 
I used the code exactly as above and now have two columns as seen here:

http://www.partypresence.co.uk/store/home.php?cat=248

How do I get the icons to show to the left of the headings (which part of the code do I edit?) and how can I get the columns to align left rather than centred like they are as I changed this part:

Code:

<td valign="top" align="center">
        <a class="alt" href="home.php?cat={ $subcategories[cat_num].categoryid }">
        {if $subcategories[cat_num].icon_url}<IMG height="100" border="0" alighn="middle" src="{if

$subcategories[cat_num].icon_url}{$subcategories[cat_num].icon_url}{else}{$xcart_web_dir}/icon.php?catego

ryid={$cat}{/if}">{/if}



and changed "center" to "left" but nothing happened?

Thanks for your help .... and thanks Padraic (Balinor) for pointing me to this mod :)

karentown 01-25-2007 05:38 AM

Re: Mod for subcategories in columns with descriptions and icons
 
OK, all done and working now on version 4.0.19 as seen here:

http://www.partypresence.co.uk/store/home.php?cat=248

The subcategories code is:

Code:

{* $Id: subcategories.tpl,v 1.43.2.9 2006/06/27 08:22:01 svowl Exp $ *}
{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}
{if $active_modules.Special_Offers and $category_offers}
<BR><BR>
{include file="modules/Special_Offers/customer/category_offers_short_list.tpl"}
{/if}
{if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description}<BR><BR>{/if}
{capture name=dialog}
{assign var="tmp" value="0"}
{section name=cat_num loop=$subcategories}
{if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if}
{/section}
{if $subcategories}
<table cellspacing="5" width="100%" border="0">
<tr>
{foreach from=$subcategories item=subcat}
{if $tmp is div by 3}
</tr><tr><td colspan="3"></td></tr><tr valign="top">
{/if}
{ if $tmp and $first_subcat ne "Y" }
{assign var="tmp" value=0}
{assign var="first_subcat" value="Y"}
{/if}
<td class="ColumnTitles" valign="top"><a title="{$subcat.description}" href="home.php?cat={ $subcat.categoryid }"><img src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_web_dir}/default_image.gif{/if}" alt="" align="middle" <br><left>
<font class="ItemsList">{ $subcat.category|escape }</font></a>
{if $config.Appearance.count_products eq "Y"}


{/if}
{assign var="tmp" value=$tmp+1}
{/foreach}
</table>
{/if}
{if $tmp and $products ne "" }
<BR clear="left">
<HR size="1" noshade>
{/if}
{if $products}
{if $sort_fields}
<DIV align="right">{include file="main/search_sort_by.tpl" sort_fields=$sort_fields
selected=$search_prefilled.sort_field direction=$search_prefilled.sort_direction
url="home.php?cat=`$cat`&"}</DIV>
{/if}
{if $total_pages gt 2}
<BR>
{ include file="customer/main/navigation.tpl" }
{/if}
<BR>
{include file="customer/main/products.tpl" products=$products}
{/if}
{if $products eq "" and $tmp eq "0"}
{$lng.txt_no_products_in_cat}
{/if}
{/capture}
{include file="dialog.tpl" title=$current_category.category content=$smarty.capture.dialog
extra="width=100%"}
{if $products eq ""}
{if $f_products ne ""}
<P>
{include file="customer/main/featured.tpl"}
{/if}
{/if}
{ include file="customer/main/navigation.tpl" }


Hope that helps someone! Thanks so much for the emails Robbert .... couldnt have done it without you!!!!

Poweredag 02-14-2007 12:27 PM

Re: Mod for subcategories in columns with descriptions and icons
 
mrkenzie's mod worked wonders. However, I have an appearance issue on one subcat only http://www.poweredag.com/home.php?cat=3 where the second row subcat title is to the right of the image. It only happens with this subcat. Any help would be appreciated.

BizzyB 02-15-2007 11:37 PM

Re: Mod for subcategories in columns with descriptions and icons
 
Quote:

Originally Posted by Poweredag
mrkenzie's mod worked wonders. However, I have an appearance issue on one subcat only http://www.poweredag.com/home.php?cat=3 where the second row subcat title is to the right of the image. It only happens with this subcat. Any help would be appreciated.


Hi,
I havent tried the mod yet but just looking at your site - have you tried reducing the number of characters in the title to see if this makes a difference? Alternatively, have you tried making the image area slightly wider.

Just a thought.

Poweredag 02-16-2007 11:00 AM

Re: Mod for subcategories in columns with descriptions and icons
 
Thanks BizzyB,

It was a title character issue as you suggested, but I solved it with a hyphen.

Wambli 02-22-2007 10:35 PM

Re: Mod for subcategories in columns with descriptions and icons
 
where do I find categories.php? to change the code

Wambli 02-22-2007 10:54 PM

Re: Mod for subcategories in columns with descriptions and icons
 
ok I found categories.php I have X-Cart v 4.1.x and can not find that code in categories.php?does anyone have this mod working on my version b/c I can't get any of them to work so far

obaluba2 02-23-2007 02:48 AM

Re: Mod for subcategories in columns with descriptions and icons
 
Hey,

I'm using the same code as KarenTown but It just wont find my category images..

PHP Code:

{* $Idsubcategories.tpl,v 1.43.2.9 2006/06/27 08:22:01 svowl Exp $ *}
{if 
$active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}
{include 
file="modules/Bestsellers/bestsellers.tpl"}
{/if}
{if 
$active_modules.Special_Offers and $category_offers}
<
BR><BR>
{include 
file="modules/Special_Offers/customer/category_offers_short_list.tpl"}
{/if}
{if (
$navigation_page eq "")||($navigation_page eq "1")}{$current_category.description}<BR><BR>{/if}
{
capture name=dialog}
{
assign var="tmp" value="0"}
{
section name=cat_num loop=$subcategories}
{if 
$subcategories[cat_num].category}{assign var="tmp" value="1"}{/if}
{/
section}
{if 
$subcategories}
<
table cellspacing="5" width="100%" border="0">
<
tr>
{foreach 
from=$subcategories item=subcat}
{if 
$tmp is div by 3}
</
tr><tr><td colspan="3"></td></tr><tr valign="top">
{/if}
{ if 
$tmp and $first_subcat ne "Y" }
{
assign var="tmp" value=0}
{
assign var="first_subcat" value="Y"}
{/if}
<
td class="ColumnTitles" valign="top"><a title="{$subcat.description}href="home.php?cat={ $subcat.categoryid }"><img src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_web_dir}/default_image.gif{/if}" alt="" align="middle" <br><left
<
font class="ItemsList">{ $subcat.category|escape }</font></a>
{if 
$config.Appearance.count_products eq "Y"}
 
{/if}
{
assign var="tmp" value=$tmp+1}
{/foreach}
</
table>
{/if}
{if 
$tmp and $products ne "" }
<
BR clear="left">
<
HR size="1" noshade>
{/if}
{if 
$products}
{if 
$sort_fields}
<
DIV align="right">{include file="main/search_sort_by.tpl" sort_fields=$sort_fields 
selected
=$search_prefilled.sort_field direction=$search_prefilled.sort_direction 
url
="home.php?cat=`$cat`&"}</DIV>
{/if}
{if 
$total_pages gt 2}
<
BR>
{ include 
file="customer/main/navigation.tpl" }
{/if}
<
BR>
{include 
file="customer/main/products.tpl" products=$products}
{/if}
{if 
$products eq "" and $tmp eq "0"}
{
$lng.txt_no_products_in_cat}
{/if}
{/
capture}
{include 
file="dialog.tpl" title=$current_category.category content=$smarty.capture.dialog 
extra
="width=100%"}
{if 
$products eq ""}
{if 
$f_products ne ""}
<
P>
{include 
file="customer/main/featured.tpl"}
{/if}
{/if}
{ include 
file="customer/main/navigation.tpl" 


I am using this on version 4.1.6 but its strange is the image location different in this version?

thanks for looking

Poweredag 02-23-2007 10:38 AM

Re: Mod for subcategories in columns with descriptions and icons
 
Quote:

Originally Posted by obaluba2
Hey,

I'm using the same code as KarenTown but It just wont find my category images..

I am using this on version 4.1.6 but its strange is the image location different in this version?


I have v4.1.3 and used mrkenzie's mod on page 14. It worked like a charm for me. The images should be uploaded to the file system, and I called them from the admin section subcat menu. You can see it working here: http://www.poweredag.com/Commercial-p-1-c-3.html
Hope that answered your question.

NightFire 04-07-2007 03:08 AM

Re: Mod for subcategories in columns with descriptions and icons
 
Looks like a great mod. Unfortunately I've forgot to keep updated with this tread.
ANybody knows which code I need to know for 4.0.17? 4.0.X version will do.
I don't need the DSEFU code as I am using DSEFU PRO, but images are stored in the file system.

Thanks for the help.


All times are GMT -8. The time now is 10:07 PM.

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