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)

adpboss 12-15-2004 01:14 PM

There is probably a way BUT it will affect how your webpages get crawled by the search engines. Surely there is a nice way to organise them rather than bogging down the navigation with multiple pages...

QVS 12-16-2004 04:27 AM

nice one, cheers for the mod.....exactly what i was looking for.

QVS 12-17-2004 04:18 AM

anyone know why the catagorys in columns 2,3,4 shift to the right?

any help would be great.

example: http://www.qvsdiscountelectrical.co.uk/qvsshop/home.php?cat=249

subcatagories.tpl

Code:

{* $Id: subcategories.tpl,v 1.43.2.2 2004/10/07 07:08:51 max Exp $ *}
{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}


 
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}


 
{if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description|regex_replace:"/[\n]/":"
"}

{/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">
<script language="JavaScript">
<!-- Hide script from older browsers
document.write('<P ALIGN="CENTER">')
document.write("<FORM>")
document.write('<INPUT TYPE = "BUTTON" VALUE = "<-- Go Back" onClick="window.history.go(-1);">')
document.write("</FORM>")
document.write("</P>")
//-->
</script> 
{/if}
{ if %cat_num.index% is div by 4}
<tr>
{/if}
<td align="center" valign="top">

{ $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}

<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
[img]{$xcart_web_dir}/icon.php?categoryid={$subcategories[cat_num].categoryid}[/img]</a>


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



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

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


{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}

 
{ 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_man}
{/if}
{/capture}
{include file="dialog.tpl" title=$current_category.category content=$smarty.capture.dialog extra="width=100%"}
{if $products eq ""}
{if $f_products ne ""}


 
{include file="customer/main/featured.tpl"}
{/if}
{/if}
{ include file="customer/main/navigation.tpl" }


Chris B 12-17-2004 07:21 AM

By default, the x-cart templates expand to the full size of your computer display settings. Therefore the table in which the categories are displayed expands to fit as well, leaving a lot of space between your category images.

In order to maintain consistent size viewable on most system settings, we generally set the width of the entire site to 760 pixels. This will allow you to left justify or center your cart also.

For example: http://www.uneedabirkenstock.com
This site is left justified as well as using the 3 column category layout.

To do this, modify the rectangle_top.tpl

from this:

Code:

<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width="100%" height="100%">

to this:

Code:

<TABLE align=center border=0 bgcolor="#FFFFFF" cellPadding=0 cellSpacing=0 width="760" bordercolor="#000000">

Depending on which version you are using there may be 2 instances of this table. (One for the customer end, and one for the administration section.)

I hope this helps...

pcdoktorn 12-26-2004 04:41 AM

Tried this in 4.0.9 and did paste in the code that was made for 4.0.8 and nothing changed at all on the page.Was there updates in categories.tpl that prevents this mod from working in 4.0.9 ?

pcdoktorn 12-26-2004 04:46 AM

Please ignore my stupidity.
Did not know I had to change the welcome.tpl file.Works fine now :)

rjcbear 12-31-2004 07:37 AM

Hello guy,

I amd kind of confused now! amd her eis ther reason why.

I implemented this mod and is working properly displaying the Icon when the cart is in the dynamic part. whent the HTML catalog is created is displaying a broken link to the images.

I my case I move all the images and icons out of the DB and place the proper code on the .htaccess file so images and Icons will display properly.

I guess I am sure where the images should be place for the HTML to display it. below is the code

Code:

<td align="center" valign="top"> <a href="LADS_Competition_Latin-p-1-c-278.html">
                              [img]../icon.php?categoryid=278[/img]
                             


if you like to see what is doing here is the link

http://www.ballroomdancingshoe.com/LADS_Competition-p-1-c-276.html

thank you in advance.

HAPPY NEW YEAR!!!!

Kind regards
Ricky

adpboss 12-31-2004 10:04 AM

RJC, I cannot understand your last post at all... :roll:

rjcbear 12-31-2004 10:47 AM

What I am trying to say is the HTML catalog is not displaying the icons at all for the subcategories. The Dynamic cart show the Icons for the subcategories.

Look at the links and see.

http://www.ballroomdancingshoe.com/LADS_Competition-p-1-c-276.html

The above show the broken links.

http://www.ballroomdancingshoe.com/store/customer/home.php?cat=276

The above link shoes the Icons.

is that better?

Kind regards,
Ricky

adpboss 12-31-2004 11:06 AM

Yup, got it now. LOL. The spelling and grammar was a little rough in the other post, I was getting confused. :?

Something is definitely wrong as I have this working on a 3.5 development no problem. The html cat pages should not be outputting icon.php but creating the actual http location of the images stored on your server.

These are just a couple of shot-in-the-dark ideas to check.

html_catalog.php, check the script array against the latest distribution (note i have included my code from an older version it could be different in the latest distro)
Code:

$php_scripts = array("search.php","giftcert.php","help.php", "cart.php", "product.php","register.php", "home.php", "pages.php", "pconf.php", "giftregs.php");

Check that your images location is set correctly in the database. Image-path in xcart-icons table. I have had a lot of troubles setting this properly.

Nice 404 page btw. :D

Good luck.


All times are GMT -8. The time now is 09:04 PM.

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