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)
-   -   Subcategires Not Displaying Correctly (https://forum.x-cart.com/showthread.php?t=36350)

rashriaz 12-24-2007 05:23 AM

Subcategires Not Displaying Correctly
 
1 Attachment(s)
Hi

Could anyone help me please, my subcategories are displaying an image with them but for some reason the first line always has more subcategories displaying than the others. PLease see pic for more detail.

This is my code for subcategories.tpl

Code:


{* $Id: subcategories.tpl,v 1.43.2.9 2006/06/27 08:22:01 svowl Exp $ *}
{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="6" 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" align="middle"><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>
<p><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" }


rashriaz 12-26-2007 12:34 AM

Re: Subcategires Not Displaying Correctly
 
Anyone got any ideas please?

gb2world 12-26-2007 04:08 PM

Re: Subcategires Not Displaying Correctly
 
You have an older version of the subcategories.tpl file than any I have - I started with XCART 4.1.8 - so if you really have a 4.1.9 xcart, you may want to upgrade the subcategories.tpl file and start with that one.

--edited -- I removed a suggestion that I had here because it may have been misleading ---

I just realized that this is really a question about the "subcategories in columns mod" - If I were you I would start with the subcategories.tpl file for 4.1.9 & make the mods to that file rather than use the old version that you displayed above

MoonDog 12-29-2007 11:54 AM

Re: Subcategires Not Displaying Correctly
 
rashriaz,

Try this:

Find these lines of code:
Code:

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

and change the "tmp" value from 0 to 1, so it looks like this:

Code:


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

Hope it works.

- MoonDog -


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.