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

Subcategory text & images for x-cart 4.1.5

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #31  
Old 06-26-2007, 05:02 AM
 
espresso espresso is offline
 

eXpert
  
Join Date: Apr 2007
Location: Ontario, Canada
Posts: 227
 

Default Re: Subcategory text & images for x-cart 4.1.5

What a great mod. I got it working on 4.1.7., thanks guys...
It would even be better if it would show how many sub categories are inside a category instead of just the total item count (just like the default tpl did). I'm sure it's just a one line "if" statement.
__________________
Rene
End user - merchant
In the upgrade process 4.6.6 to 5.4.x


Mods I miss in 5.4.x:
xCMS, Create-A-Sale, On-Sale AC, Kit Builder AC, Manufacturer-A-Z BCSE, Product-Bundle BCSE, Pre-Order BCSE, Customer Quotes BCSE
Reply With Quote
  #32  
Old 07-10-2007, 03:13 PM
 
Funinc Funinc is offline
 

Senior Member
  
Join Date: Sep 2002
Location: CA
Posts: 108
 

Default Re: Subcategory text & images for x-cart 4.1.5

After beating my head againist the wall, I finally figured it out. The images have to be in your file system not database. Changed it and it works perfectly....
Reply With Quote
  #33  
Old 07-17-2007, 03:28 PM
 
Coach Wireless Coach Wireless is offline
 

Newbie
  
Join Date: Jul 2007
Posts: 2
 

Default Re: Subcategory text & images for x-cart 4.1.5

Has anyone gotten this mod to work on v4.1.8?
__________________
http://coachwireless.com
http://heidicoaches.com


Both Sites with X-Cart Version 4.1.8
Reply With Quote
  #34  
Old 07-18-2007, 01:18 PM
 
kanjigirl kanjigirl is offline
 

Advanced Member
  
Join Date: Feb 2007
Posts: 51
 

Default Re: Subcategory text & images for x-cart 4.1.5

I have this working nicely in Firefox:

http://www.parallaxwebdesign.com/projects/timbercreek/xcart/home.php?cat=275

However in IE7 it puts a big wide space between the left menu and the subcats. Can anyone tell me why this might be happening?
__________________
Debbie Campbell
www.redkitecreative.com
X-Cart Version 4.1.6
Reply With Quote
  #35  
Old 07-18-2007, 01:37 PM
 
kanjigirl kanjigirl is offline
 

Advanced Member
  
Join Date: Feb 2007
Posts: 51
 

Default Re: Subcategory text & images for x-cart 4.1.5

Never mind, I answered my last question - adding a description to the category made it take up the full space in IE7.
__________________
Debbie Campbell
www.redkitecreative.com
X-Cart Version 4.1.6
Reply With Quote
  #36  
Old 07-20-2007, 11:35 AM
  Madhatterr's Avatar 
Madhatterr Madhatterr is offline
 

eXpert
  
Join Date: Jan 2007
Posts: 202
 

Question Re: Subcategory text & images for x-cart 4.1.5

I'm working on modifying my files to test this out and I got a strange bit of text I'm not sure how to get rid of. Please see the attached JPG.
Thanks to anyone who can help out with this total mind bender!

Since I know you may need to look at my code here it is for my subcategories.tpl -

Quote:
{* $Id: subcategories.tpl,v 1.55.2.1 2006/06/27 08:20:37 svowl Exp $ *}
{if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description}<p />{/if}
{assign var="tmp" value="0"}
{foreach from=$subcategories item=c key=catid}
{if $c.category}{assign var="tmp" value="1"}{/if}
{/foreach}
{if $tmp and $first_subcat ne "Y"}
<div style="float:right;"><img src="{if $current_category.icon_url}{$current_category.icon _url}{else}{$xcart_web_dir}/image.php?id={$cat}&amp;type=C{/if}" alt="" /></div>
{assign var="first_subcat" value="Y"}
<br style="clear:left;" />
{/if}

{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu ne "Y"}
<p />
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}
<p />
{if $active_modules.Special_Offers}
{include file="modules/Special_Offers/customer/category_offers_short_list.tpl"}
{/if}
{capture name=dialog}
{if $subcategories}
{assign var="cntr" value="0"}
<table cellspacing="5" width="100%" border="0">
<tr align="right">
{foreach from=$subcategories item=subcat}
{if $cntr is div by 2}
<td colspan="3" align="right"></td></tr><tr>
{/if}
{if $first_subcat ne "Y"}
{assign var="first_subcat" value="Y"}
{/if}
<td align="right"><a title="{$subcat.category|escape}" href="home.php?cat={$subcat.categoryid}"><img src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_w eb_dir}/hsnopic.jpg{/if}" alt="{$subcat.category|escape}" /></a></td>
<td align="right" class="ColumnTitles"><a title="{$subcat.category|escape}" href="home.php?cat={$subcat.categoryid}">
<font class="ItemsList">{$subcat.category|escape}</font></a></td>
{if $config.Appearance.count_products eq "Y"}
{if $subcat.product_count}{$subcat.product_count}{$lng .lbl_products}
{elseif $subcat.subcategory_count}{$subcat.subcategory_cou nt}{$lng.lbl_categories|lower}
{else} 0 Products
{/if}
{/if}
{assign var="cntr" value=$cntr+1}
{/foreach}
</tr>
</table>
{/if}
{if $tmp and $products ne "" }
<br clear="left" />
<hr size="1" noshade="noshade" />
{/if}
{if $products}
{if $sort_fields}
<div style="float: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 style="clear:both;" /><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 />
<hr size="1" noshade="noshade" />
{capture name=dialog}
{include file="customer/main/products.tpl" products=$f_products featured="Y"}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_featured_products content=$smarty.capture.dialog extra="width=100%"}
<p />
{/if}
{include file="customer/main/navigation.tpl"}
Attached Thumbnails
Click image for larger version

Name:	issue.JPG
Views:	198
Size:	32.5 KB
ID:	483  
__________________
DeAnna Ross
http://madhatterrgames.com [v.4.1.8] Fashion Template
http://www.hortonstores.com [v.4.1.12] Fashion Mosaic Skin
http://teststore.hortonstores.com [v.4.2.2] Fashion Mosaic Skin TEST STORE - NOT FOR ACTUAL SHOPPING!
Reply With Quote
  #37  
Old 07-20-2007, 11:52 AM
 
kanjigirl kanjigirl is offline
 

Advanced Member
  
Join Date: Feb 2007
Posts: 51
 

Default Re: Subcategory text & images for x-cart 4.1.5

I saw something like that (Madhatterr) when I was trying to get this to work, but I don't remember exactly what produced it...

Maybe this might help - here's my code from /customer/main/subcategories.tpl:

Code:
{* this section from forum to allow subcat images *} {if $subcategories} <table cellspacing="5" width="100%" border="0"> <tr> {foreach from=$subcategories item=subcat} {if $tmp is div by 2} </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="" /> <p class="ItemsList">{ $subcat.category|escape }</p></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} </td> </tr> </table> {/if} {* end subcat image code from forum*}

And from skin1_c.css:

Code:
.ColumnTitles { margin: 0; padding: 5px 5px 0 5px; text-align: center; width: 33%; } .ItemsList { padding: 0; color: #374C79; font-weight: bold; font-size: 12px; }
__________________
Debbie Campbell
www.redkitecreative.com
X-Cart Version 4.1.6
Reply With Quote
  #38  
Old 07-20-2007, 12:52 PM
  Madhatterr's Avatar 
Madhatterr Madhatterr is offline
 

eXpert
  
Join Date: Jan 2007
Posts: 202
 

Default Re: Subcategory text & images for x-cart 4.1.5

Thank you sooo much for the help Kanjigirl. Here's my full (working) subcategories.tpl code.
My version at this point is 4.1.8 -

Quote:

{* $Id: subcategories.tpl,v 1.55.2.1 2006/06/27 08:20:37 svowl Exp $ *}
{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu ne "Y"}
<p />
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}
<p />
{if $active_modules.Special_Offers}
{include file="modules/Special_Offers/customer/category_offers_short_list.tpl"}
{/if}
{if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description}<p />{/if}
{capture name=dialog}
{assign var="tmp" value="0"}
{foreach from=$subcategories item=c key=catid}
{if $c.category}{assign var="tmp" value="1"}{/if}
{/foreach}

{if $subcategories}
<table cellspacing="5" width="100%" border="0">
<tr>
{foreach from=$subcategories item=subcat}
{if $tmp is div by 2}
</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.category|escape}" href="home.php?cat={$subcat.categoryid}"><img src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_w eb_dir}/default_image.gif{/if}" alt="{$subcat.category|escape}" /></a><br><a title="{$subcat.category|escape}" href="home.php?cat={$subcat.categoryid}" align="center">
<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}
</td>
</tr>
</table>
{/if}

{if $tmp and $products ne "" }
<br clear="left" />
<hr size="1" noshade="noshade" />
{/if}
{if $products}
{if $sort_fields}
<div style="float: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 style="clear:both;" /><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 />
<hr size="1" noshade="noshade" />
{capture name=dialog}
{include file="customer/main/products.tpl" products=$f_products featured="Y"}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_featured_products content=$smarty.capture.dialog extra="width=100%"}
<p />
{/if}
{include file="customer/main/navigation.tpl"}


Hope this helps others!
__________________
DeAnna Ross
http://madhatterrgames.com [v.4.1.8] Fashion Template
http://www.hortonstores.com [v.4.1.12] Fashion Mosaic Skin
http://teststore.hortonstores.com [v.4.2.2] Fashion Mosaic Skin TEST STORE - NOT FOR ACTUAL SHOPPING!
Reply With Quote
  #39  
Old 07-26-2007, 12:23 PM
  Madhatterr's Avatar 
Madhatterr Madhatterr is offline
 

eXpert
  
Join Date: Jan 2007
Posts: 202
 

Default Re: Subcategory text & images for x-cart 4.1.5

Okay,

Seems I am having a issue still... for some reason the subcat icon pics aren't showing and it keeps showing the nopic.gif default. Anyone know what's up with that? My code is as posted above.

Thanks!
__________________
DeAnna Ross
http://madhatterrgames.com [v.4.1.8] Fashion Template
http://www.hortonstores.com [v.4.1.12] Fashion Mosaic Skin
http://teststore.hortonstores.com [v.4.2.2] Fashion Mosaic Skin TEST STORE - NOT FOR ACTUAL SHOPPING!
Reply With Quote
  #40  
Old 07-26-2007, 04:19 PM
 
Seacat Seacat is offline
 

Advanced Member
  
Join Date: Feb 2007
Posts: 29
 

Default Re: Subcategory text & images for x-cart 4.1.5

The pics should be in the file system instead of the database for it to work. Someone else discovered that when they were having display problems for the icons. If yours are in the file system, then of course something else is going on.
__________________
Seacat
X-Cart Gold v4.1.6 [linux]
PHP 5.2.2
My SQL 5.0.24
DSEFU Mod
Cartlab CSS Skin
Several other mods
Self-Defense Weapons
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 11:14 PM.

   

 
X-Cart forums © 2001-2020