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
  #21  
Old 06-05-2007, 02:37 PM
 
roblen roblen is offline
 

Senior Member
  
Join Date: Oct 2004
Posts: 114
 

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

Seems to work except that the first row is one category too many
if divide by 2 then the first row has three cats and the following rows are correct with two.
is anyone else getting this.?
version 4.1.7

I solved it for me.
the code that assigns sthe var to 0 sould be 1

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

needs to be changed to

{ if $tmp and $first_subcat ne "Y" }
{assign var="tmp" value=1}
{assign var="first_subcat" value="Y"}
__________________
X-Cart version 4.1.9
PHP 5.2.13 Details >>
GD bundled (2.0.34 compatible)
MySQL server 5.0.77-log
MySQL client 5.0.77
Web server Apache/2.2
Operation system Linux
Perl not found
XML parser (expat) found
Reply With Quote
  #22  
Old 06-05-2007, 03:50 PM
 
Seacat Seacat is offline
 

Advanced Member
  
Join Date: Feb 2007
Posts: 29
 

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

I don't know why that is on your system. Mine displays in two columns all the way down. Had the problem with one column on first and last rows until setting the cntr variable to 0 at the start. If it works for you that way, great!
__________________
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
  #23  
Old 06-08-2007, 04:01 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

I have all the parts in and working with the excepition of the category image showing.

see example:
http://www.nastygear.com/nastygear/home.php?cat=115
Beware adult products

Has anyone been able to get sub category icon images to show in version 4.1.3

Thanks,
Timm
Reply With Quote
  #24  
Old 06-08-2007, 05:07 PM
 
Seacat Seacat is offline
 

Advanced Member
  
Join Date: Feb 2007
Posts: 29
 

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

Would you mind double checking your code for spaces? Particularly {$xcart_w eb_dir} and a few others have some spaces in there that were included during the post to the forum. Don't know why this happens. Have seen it in many threads where spaces are arbitrarily added during posting of code.

Double check that, if that isn't the problem, make sure you have assigned a category icon and that you can see it there in admin. You've probably already done this....Also, I think you may need to add a product to the category before the cat image will show. If none of this fixes your problem, I'll try to help if I can. I'm no expert though.
__________________
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
  #25  
Old 06-15-2007, 05:41 AM
 
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

I have checked and removed all spaces. I have the Icon in the sub category in the admin and I have products added and still nothing....Help...anyone???
Reply With Quote
  #26  
Old 06-15-2007, 12:01 PM
 
Seacat Seacat is offline
 

Advanced Member
  
Join Date: Feb 2007
Posts: 29
 

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

Sounds like things are in order. Did you make the change to categories.php as outlined in post #1? I don't know how much difference there is between 4.1.3 and 4.1.6 with this. Can you post your subcategories.tpl? I'll see if I can help...Also, don't know what your original 4.1.3 code looked like in subcategories.tpl but in post #1 there was an [images] tag mentioned. Haven't seen that code to know if it was in there or not. May want to check and see the placement on that.
__________________
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
  #27  
Old 06-15-2007, 01:38 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

Here is my subcategories.tpl...I have done all mentioned.

Thanks for taking a look

This I have implemented on a different cart with version 4.1.6

Same issue

{* $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}
{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}/default_image.gif{/if}" alt="{$subcat.category|escape}" /></a></td>
<td align="left" 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 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" }
Reply With Quote
  #28  
Old 06-15-2007, 02:01 PM
 
Seacat Seacat is offline
 

Advanced Member
  
Join Date: Feb 2007
Posts: 29
 

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

OK, looked at your code there. You have a couple of other things going on at the beginning. Maybe you could paste my code in there and then add your other changes in to see if it breaks.

{* $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}/self-defense-weapons.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"}



Change this part: {$xcart_web_dir}/self-defense-weapons.jpg for your default image. You may have to check again for spaces added during this post. This should fly for you. Then tweak it to suit for your Bestsellers and other stuff you have in there.

Let me know...

Oh forgot to mention, this file has been modded to show featured products on subcats that have products in them. Had to modify home.php lines 45-49 have been changed to this

#if (!empty($cat))
# include "./products.php";

if (empty($products))
include "./featured_products.php";

if (!empty($cat))
include "./products.php";

Which runs to line 52. Got this from another post.
__________________
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
  #29  
Old 06-15-2007, 02:11 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

check it out same results

http://jodyforster.com/v416/home.php?cat=1
__________________
Timm
Internet Performance
http://internetperformance.net

Baggagequest.com (V-4.1.6)- ton of custom work
Jodyforster.com (V-4.1.6) XC SEO-VARAINTS
Planetdrywash.com (V-4.1.9) XC SEO
Nastygear.com (V-4.1.3)
Reply With Quote
  #30  
Old 06-15-2007, 02:59 PM
 
Seacat Seacat is offline
 

Advanced Member
  
Join Date: Feb 2007
Posts: 29
 

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

Yeah, i see that...Looks real good if the images would pop in there.

Your view source shows this:
<img src="/v416/default_image.gif" alt="Antenna Pennants" />

Mine shows this:

<img src="http://www.misdefenseproducts.com/images/C/diversion-safe-DS-PEANUTBUTTER.jpg" alt="diversion safe" />

That it pulls from this part in the code:

<img src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_web_dir}/self-defense-weapons.jpg{/if}" alt="{$subcat.category|escape}" />

I suppose you've discovered that yours is pulling from the else condition.

I'm not an expert, but the highlighted part above seems to not be picking up. I'm sure you've been around this already. If the image shows in your admin side, it should pick that part up and display it.
My first thought would be some path problem somewhere. I guess this is as far as I can go with this. Maybe someone else can help you. Sorry! When you get it fixed, please let me know what it was. I'm curious because this should be working for you, same version, same code. Hmmmm.

Perhaps it could be permissions or something. I'd troubleshoot by adding a hard coded url to an image in your images/C directory over the highlighted part and see if it picks up. If it does then put the code back and it shouldn't be permissions on the directory, its somewhere else. Just a thought.
__________________
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 12:22 PM.

   

 
X-Cart forums © 2001-2020