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)

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 05:35 AM.

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