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)

mrkenzie 08-22-2006 10:26 AM

Re: Mod for subcategories in columns with descriptions and icons
 
I fixed my original post on page 14, so everything should work fine now.

Let me know if there are any more issues

districtsix 09-12-2006 12:28 PM

Re: Mod for subcategories in columns with descriptions and icons
 
Hey,
I tried the post revision on page 14... my layout for subcategories is all stuck on the default image. I have an image uploaded under the "zaki" category, but it's not connecting http://districtsixmusic.com/store/home.php?cat=249


mrkenzie 09-12-2006 12:31 PM

Re: Mod for subcategories in columns with descriptions and icons
 
What version of X-Cart are you using?

pinklinoleum 09-12-2006 11:34 PM

Re: Mod for subcategories in columns with descriptions and icons
 
I was wondering if anyone knew how to call the root category icon from the filesystem instead of the DB?



Version 4.0.x

kunal 09-27-2006 12:45 PM

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

i have the this thread over and over and tried lots of different ways, everything works fine aprt from showing the Categories description can somebody please explain what the correct smarty tag is or what i need to change and add to display this, x-cart version in sig

louielou 09-30-2006 11:11 AM

Re: Mod for subcategories in columns with descriptions and icons
 
This looks good. But is it possible to have the image/text link to another subcatagory instead of a product?

mrkenzie 09-30-2006 11:58 AM

Re: Mod for subcategories in columns with descriptions and icons
 
If there are subcategories, it will link to the subcategories, otherwise, it will link to the products.

zenkiss 10-03-2006 03:54 PM

Re: Mod for subcategories in columns with descriptions and icons
 
Hello -

I am almost have this perfect for my site as I have stripped away some code. Can some one please tell me how I can make the catagory icons (thumbnails) show up above the text and make those images a link as well.

Thank you

Here is my current code


-------------------------------

Code:

{* $Id: subcategories.tpl,v 1.43.2.7 2005/10/28 05:23:51 svowl Exp $ *}

{capture name=dialog}

{if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description}{/if}<br><br>
{assign var="tmp" value="0"}
{section name=cat_num loop=$subcategories}
{if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if}
{/section}


{section name=cat_num loop=$subcategories}
{ if %cat_num.first% }
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
{/if}
{ if %cat_num.index% is div by 4}
<tr>
{/if}
<td align="center" valign="top">
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
{if $subcategories[cat_num].icon_url}<img src="{$subcategories[cat_num].icon_url}" border="0" style="padding-bottom: 5px;">{else}<img src="{$xcart_web_dir}/default_icon.gif" border="0" style="padding-bottom: 5px;">{/if} </a><br /><br />
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
<b>{ $subcategories[cat_num].category|escape }</b></a><br><br>
                        { $subcategories[cat_num].description|escape }</td>
{ if %cat_num.last% }
</tr>
</table>
{/if}
{/section}
{if $total_pages gt 2}
<br>
{ include file="customer/main/navigation.tpl" }
{/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 ""}
<BR><BR>
{include file="customer/main/featured.tpl"}
{/if}
{/if}
{ include file="customer/main/navigation.tpl" }


----------------------

Edit, it looked good until going into one of the suncats as I wiped out the products, hmmmmm......

finestshops 10-03-2006 04:03 PM

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

try to change

{if $subcategories[cat_num].icon_url} ... {/if}

to

<A href="home.php?cat={ $subcategories[cat_num].categoryid }"><IMG alt="{ $subcategories[cat_num].category|escape }" border="0" src="{if $subcategories[cat_num].icon_url}{$subcategories[cat_num].icon_url}{else}{$xcart_web_dir}/icon.php?categoryid={$subcategories[cat_num].categoryid}{/if}"></a>

zenkiss 10-03-2006 04:20 PM

Re: Mod for subcategories in columns with descriptions and icons
 
1 Attachment(s)
That worked great 27Stars- Thank you! This really should be built into X-cart.

If you saw my last part of the edit, I took the products off and changed some code about. When I click one of the icons now it goes to proper subcat but shows no products (my fault).

1 - I see no products (I know that is because I took out the variable) I was trying to get it to show just the icon and sub cat name and no products underneath as with this mod as it is. But that wiped out my products inside the subcat where they should show.

I am almost keep having it but mess it up :(

Thank you again

I am after this looking the way it does with these as the subcats then the page you would get there products

jessej 10-10-2006 04:30 PM

Re: Mod for subcategories in columns with descriptions and icons
 
I tried it but it makes my category show up with nothing in it? :( Any help would be greatly appreciated.

Zak 10-16-2006 11:12 AM

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

I've reviewed this whole thread and have seen mention of this, but no working solutions. I'm currently working with a X-Cart version 4.0.19 and am trying to get the subcategory descriptions to show up under the category title. I've tried:
{ $subcategories[cat_num].description|escape }

but absolutely nothing happens using that. I suspect I'm calling this wrong, but don't have a clue how else it might be called. Any help on this much appreciated. Thanks.

IAPDirect.com 11-13-2006 07:56 AM

Re: Mod for subcategories in columns with descriptions and icons
 
I am using the version shown below and it shows that there are no subcategories available with some clickable links that link back to the main page. Can someone please clarify what code needs to be replaced in my version?

thanks.

ptcsstore 11-16-2006 07:53 AM

Re: Mod for subcategories in columns with descriptions and icons
 
Ok, I have this mod working sort of, It is displaying my categories, but for some reason it starts with a blank space, and does not include my last category. The last category that should appear is dancing poles. It shows up fine in the sidebar menu. Thanks. http://72.34.43.238/store/

Code:

{* $Id: subcategories.tpl,v 1.43.2.7 2005/10/28 05:23:51 svowl Exp $ *}

{capture name=dialog}

{if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description}{/if}<br><br>
{assign var="tmp" value="0"}
{section name=cat_num loop=$subcategories}
{if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if}
{/section}


{section name=cat_num loop=$subcategories}
{ if %cat_num.first% }
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
{/if}
{ if %cat_num.index% is div by 3}
<tr>
{/if}
<td align="center" valign="top">
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
{if $subcategories[cat_num].icon_url}<img src="{$subcategories[cat_num].icon_url}" border="0" style="padding-bottom: 5px;">{else}<img src="{$xcart_web_dir}/default_icon.gif" border="0" style="padding-bottom: 5px;">{/if} </a><br /><br />
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
<b>{ $subcategories[cat_num].category|escape }</b></a><br><br>
                        { $subcategories[cat_num].description|escape }</td>
{ if %cat_num.last% }
</tr>
</table>
{/if}
{/section}
{if $total_pages gt 2}
<br>
{ include file="customer/main/navigation.tpl" }
{/if}
{if $products eq "" and $tmp eq "0"}
{$lng.txt_no_products_in_cat}
{/if}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_categories_home content=$smarty.capture.dialog extra="width=100%"}
{if $products eq ""}
{if $f_products ne ""}
<BR><BR>
{include file="customer/main/featured.tpl"}
{/if}
{/if}
{ include file="customer/main/navigation.tpl" }


sandersdesign 11-21-2006 01:05 PM

Re: Mod for subcategories in columns with descriptions and icons
 
hi, great mod, but how do I show sub-subcategories, I’d like to show the following;

Subcategory Title
Sub-subcategory Title - Sub-subcategory Icon

Any help welcome, thanks

boxerbay 11-28-2006 10:05 AM

Re: Mod for subcategories in columns with descriptions and icons
 
why do i get bracket img bracket displaying instead of the image?

Code:

{* $Id: subcategories.tpl,v 1.34 2003/10/06 10:04:00 svowl Exp $ *}
{ include file="location.tpl" }
{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}
<p>
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}
<p>
{ include file="customer/main/navigation.tpl" }
{if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description|regex_replace:"/[\n]/":"<BR>"}<P>{/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}


{* ==================== Sub categories mod start *}

{section name=cat_num loop=$subcategories}
{ if %cat_num.first% }
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
{/if}
{ if %cat_num.index% is div by 2}
<tr>
{/if}
<td align="center" valign="top">
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
[img]../icon.php?categoryid={$subcategories[cat_num].categoryid}[/img]</a>

 
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
<font size="3">{ $subcategories[cat_num].category|escape }</font></a>




{ $subcategories[cat_num].description|escape }
{if $config.Appearance.count_products eq "Y"}
{if $subcategories[cat_num].product_count}
 
({ $subcategories[cat_num].product_count } Products)
{elseif $subcategories[cat_num].subcategory_count}
({ $subcategories[cat_num].subcategory_count } Subcategories)
{/if}
{/if}
</td>
{ if %cat_num.last% }
</tr>
</table>
{/if}
{/section}

{* ==================== Sub categories mod end *}





{if $tmp and $products ne "" }
<br clear=_all><hr size=1 noshade>
{/if}
{include file="customer/main/products.tpl" products=$products}
{if $products eq "" and $tmp eq "0"}
{$lng.txt_no_products_in_cat}
{/if}
{/capture}
{include file="dialog.tpl" title=$current_category.category_name|regex_replace:"/.*\//":"" 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" }


Version 3.5.12
http://www.miamistartruckparts.com/shop/customer/home.php?cat=88

mrkenzie 11-28-2006 10:41 AM

Re: Mod for subcategories in columns with descriptions and icons
 
In your code you have [img] this should be changed to a valid img tag i.e.:
Code:

<img source=blah>
The posts got messed up when they upgraded a while back, so in all of the code that was posted, the img tags are messed up. Just make it a valid img tag and it will work.

boxerbay 11-28-2006 11:13 AM

Re: Mod for subcategories in columns with descriptions and icons
 
U Da Man!

xsgear 11-28-2006 07:37 PM

Re: Mod for subcategories in columns with descriptions and icons
 
After applying this mod I now have my site navagation showing twice at the top of page, where as before it was showing only once. What can I do to get it back to showing only once?

Adrenalin Village :: Paintball
Adrenalin Village :: Paintball

ryan c. 12-14-2006 09:13 AM

Re: Mod for subcategories in columns with descriptions and icons
 
Well after digging thru this thread I finally got this to work. I am running 4.0.17 here is my subcategories.tpl for anyone interested:

Code:


{* $Id: subcategories.tpl,v 1.43.2.7 2005/10/28 05:23:51 svowl Exp $ *}

{if $products|@count eq 1}
        {assign var="prodURL" value="product.php?productid=`$products.0.productid`&cat=$cat&page=1"}
        {php}
                header( "Location: " . $GLOBALS[smarty]->_tpl_vars[prodURL] );
        {/php}
{/if}


{if $active_modules.Bestsellers ne "" and $config.Modules.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|regex_replace:"/[\n]/":"<BR>"}<P>{/if}
{capture name=dialog}
{assign var="tmp" value="0"}


{section name=cat_num loop=$subcategories}

{ if %cat_num.first% }
<table border=0 cellspacing=5 width=100%>
{/if}

  {if $smarty.section.cat_num.index is div by 3}
    </tr><tr valign="top">
  {/if}

        <td valign="top" align="center"><ceter>
        <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?categoryid={$cat}{/if}">{/if}
        </a><br><b><center><a class="alt" href="home.php?cat={ $subcategories[cat_num].categoryid }">
        {$subcategories[cat_num].category|escape}</a>

        { $categories[cat_num].description|escape }
</center></b><p>        </td>
       

{ if %cat_num.last% }
</tr></table>
{/if}

{/section}
{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}
<HR size="1" width="100%">
{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" }


And here is how it looks:
http://www.coopers-seafood.com/shop/home.php?cat=15
BTW I do store my files in the file system and NOT the database.

Thanks for all the help in this thread.

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.

balinor 04-07-2007 04:44 AM

Re: Mod for subcategories in columns with descriptions and icons
 
Just read through the thread, you'll get to the 4.0.x version after a couple of pages

NightFire 04-07-2007 09:06 AM

Re: Mod for subcategories in columns with descriptions and icons
 
Got it partially working. Somehow the images are not showing up in FireFox. In Internet Explorer everything works fine.
Looks like the images are trying to load from a different url in FireFox, and therefore it cannot find the images.
Really strange...

Code:

{* ==================== Sub categories mod start *}

{if $subcategories}
{section name=cat_num loop=$subcategories}
{ if %cat_num.first% }
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
{/if}
{ if %cat_num.index% is div by 3}
<tr>
{/if}
<td align="center" valign="top">
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
{if $subcategories[cat_num].icon_url}<img src="{$subcategories[cat_num].icon_url}" border="0" style="padding-bottom: 5px;">{else}<img src="{$xcart_web_dir}/default_icon.gif" border="0" style="padding-bottom: 5px;">{/if} </a><br /><br />
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
<b>{ $subcategories[cat_num].category|escape }</b></a><br><br>
                        { $subcategories[cat_num].description|escape }</td>
{ if %cat_num.last% }
</tr>
</table>
{/if}
{/section}
{/if}


{* ==================== Sub categories mod end *}


balinor 04-07-2007 09:16 AM

Re: Mod for subcategories in columns with descriptions and icons
 
Keep reading...I added a modification to call the images from the filesystem instead of the DB.

NightFire 04-07-2007 09:23 AM

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

Originally Posted by balinor
Keep reading...I added a modification to call the images from the filesystem instead of the DB.


I did ;). Read all 20 pages.
If I am correct, this was your solution for the file system:
Code:

{if $subcategories[cat_num].icon_url}[img]{$subcategories[cat_num].icon_url}[/img]{else}[img]{$xcart_web_dir}/default_icon.gif[/img]{/if}

But that one is already implemented, and only works for the internet explorer browser. Still not getting any images in my FireFox browser. Checked all code snippets from other users, and can't find the solution. What am I doing wrong?

balinor 04-07-2007 12:23 PM

Re: Mod for subcategories in columns with descriptions and icons
 
Sorry, mis-read the code. When you view the source code in firefox, it is showing the correct link? Do you have the permissions set properly on the files folder where the images are? Do you have the .htaccess file in there set to 'allow from all'?

NightFire 04-07-2007 05:25 PM

Re: Mod for subcategories in columns with descriptions and icons
 
Just viewed the source:

Code:

<td align="center" valign="top">
<a href="home.php?cat=1">
<img src="http://localhost/shop\files\NightFire\WPS.jpg" border="0" style="padding-bottom: 5px;"> </a><br /><br />
<a href="home.php?cat=1">
<b>Water Pashmina klein</b></a><br><br>
                        </td>


I'm testing it on the localhost server at the moment. And as you can see, the slashed are used in two ways in the link: / and \
Normally it should just be like: /
Somehow Internet Explorer is not having any problems with this, but FireFox does.

Haven't checked it on my live server yet, don't want to take the risk of having the customers experiencing the problem.

trickyjoe 04-13-2007 08:57 AM

Re: Mod for subcategories in columns with descriptions and icons
 
I'm sure I've read this somewhere before and want to link the two things together, but...

I'm trying to get the following code to display the first product image from within the category if the category image does not exist.

<img src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_w eb_dir}/{GET FIRST_PRODUCT_IMAGE.jpg}{/if}" alt="{$subcat.description}" align="middle" border="0">

I know thats not the code I need :P but I'm crap with php and its doing my head in. Please can anyone help. Cheers

Joe

Zero 04-27-2007 09:56 PM

Re: Mod for subcategories in columns with descriptions and icons
 
I dont know how the code works very well, I was able to follow the instructions and get the subcategory images to work, however I cant them to stay two in a row. No matter where I set div by I cant get two images in a single row.

div by 3 is 4 in a row, div by 2 is three on top, two in the middle, and one on the bottom, and div by 1 is one in each row.

What am I doing wrong? Here is one of the pages http://bulletproofautomotive.net/store/home.php?cat=261 Im wondering if it has anything to do with the images not all being the exact same size?

I have the latest version..4.X

Art lopez 04-29-2007 06:25 PM

Re: Mod for subcategories in columns with descriptions and icons
 
This is a great mod that should be implemented into x-cart. It is working on my website but it seems the text is not centered under the image. I noticed that if I minimize the page it does center up. Currently running my thumbnails at 100 and wondering if I should resize them bigger to get them more centered.

chawla@moviesandgamesonli 04-30-2007 05:56 AM

Re: Mod for subcategories in columns with descriptions and icons
 
Can someone please enter the complete code for this mod as its quite confusing at the moment.


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

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