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)
-   -   Grouping Categories for better viewing (https://forum.x-cart.com/showthread.php?t=8237)

WPOO 04-28-2005 12:10 PM

Does anyone know if it is possible.
 
I trying to get all my products under a cateory in a list. does anyone know how to do this?

Example:

Computers Shuttle:

Product Price Information
-------------------------------------------------------------------------------
product 1 100 yes
-------------------------------------------------------------------------------
product 2 184 yes
-------------------------------------------------------------------------------product 3 190 yes
-------------------------------------------------------------------------------



is this possible?

Thanks in advance for any answers.

WP

BCSE 05-01-2005 12:55 PM

I'm not sure what you mean as the products in X-cart are listed under a category. ??

Maybe picture would be helpful of what you want it to look like?

Carrie

artinion 05-03-2005 08:54 PM

I liked the example on the reffered web site.. Is there a way to create separate category listings in separate boxes? The example shows separate category listings but are grouped together in one box.

I am developing our new look on 4.0.12. Has anyone tried using the sample code on 4.0.12 with success? How was your mileage?

ainion

BCSE 05-16-2005 09:39 PM

Yes you should be able to do that. Would be a bit trickier. Did you get it figured out? I realize I"m responding quite a bit after you last posted.

Carrie

IndieDepot 05-21-2005 02:40 AM

Carrie,

I get the same "Blank Box" that 01bodyjewellery clamined to have gotten.

I backed up my original and copy/pasted your code above exactly as you instructed us to. After refresh, categories box comes back blank. Here is my entire modified categories.tpl file that i modified according to your instructions above:


Code:

{* $Id: categories.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"}
{else}
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}

{if $categories[cat_num].order_by eq 50 || $categories[cat_num].order_by eq 100 || $categories[cat_num].order_by eq 150}

 {* NOTE: CHANGE THIS
 TO BE WHAT EVER YOU WANT TO DIVIDE THE CATEGORIES *}
{/if}

<font class=CategoriesList>{ $categories[cat_num].category_name|escape }</font>
 
{/section}
{else} {section name=cat_num loop=$subcategories}
<FONT class="CategoriesList">{$subcategories[cat_num].category}</FONT>

{/section}
{/if}
{/if}
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }


Using the above code, i get a blank categories box.

Now I will say this....
You told us to "Look for a section of code in skin1/customer/categories.tpl that looks like this: " and i find that my code is not exactly the same as the code you told us to look for. It is identical except for the a href link code.

The code you told us to look for:
Code:

<font class=CategoriesList>{ $categories[cat_num].category_name|escape }</font>

The code of my original file:
Code:

<FONT class="CategoriesList">{$categories[cat_num].category}</FONT>

Notice Carrie the difference towards the end of my code and how it's missing a few things. Welp, that's the way it came from the factory. Maybe 4.0.13 has a totally different categories.tpl file that will not work with your cool mod.

Hopefully you can check it out for us. *smile*

I am going back to FunkyCategories for the time being.

- Shannon

BCSE 05-21-2005 07:13 PM

My code was for version 3.x Looks like version 4 needs a slight change. Try this:

Code:

{* $Id: categories.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"}
{else}
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}

{if $categories[cat_num].order_by eq 50 || $categories[cat_num].order_by eq 100 || $categories[cat_num].order_by eq 150}

 {* NOTE: CHANGE THIS
 TO BE WHAT EVER YOU WANT TO DIVIDE THE CATEGORIES *}
{/if}

<font class=CategoriesList>{ $categories[cat_num].category_name|escape }</font>

{/section}
{else} {section name=cat_num loop=$subcategories}
<FONT class="CategoriesList">{$subcategories[cat_num].category}</FONT>

{/section}
{/if}
{/if}
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }


Let me know if that works and I'll include both in my free mod. Should work fine.

Thanks!

Carrie

AgileMolecule 05-21-2005 08:00 PM

Carrie-

This is exactly what I need but as I am an XCart virgin I really need a bit of guidance here if you have the time. Thanks in advance!

I am not understanding how the categories populate the menu area once this code is put in place. I can insert for example text or a line where you have directed us and it does show up fine but I just don't see any of the actual categories rendering.

I am obviously missing something here. Can you advise?

AgileMolecule 05-21-2005 08:53 PM

Got it to work- two of the classes did not have quotations and what do I know but when I took out the "return" it worked so hopefully this helps someone out- Thanks for the work on your end Carrie this has really helped me out.

Code:

{* $Id: categories.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"}
{else}
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}
{if $categories[cat_num].order_by eq 50 || $categories[cat_num].order_by eq 100 || $categories[cat_num].order_by eq 150}

 --------------------{* NOTE: CHANGE THE LINES TO BE WHAT EVER YOU WANT TO DIVIDE THE CATEGORIES *}
{/if}
<FONT class="CategoriesList">{$categories[cat_num].category}</FONT>

{/section}
{else} {section name=cat_num loop=$subcategories}
<FONT class="CategoriesList">{$subcategories[cat_num].category}</FONT>

{/section}
{/if}
{/if}
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }


AgileMolecule 05-21-2005 09:08 PM

More lame coding from an XCart virgin.....

I imagine you pros can rip this to shreds but maybe it will help someone out-

Try this one out:

Remember to set your initial category numbers in the admin side according to what is in original Carrie's code- I just tweaked it a tad more here as an example.

Code:

{* $Id: categories.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"}
{else}
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}

{if $categories[cat_num].order_by eq 5}

COOL STUFF AAA

{/if}
{if $categories[cat_num].order_by eq 50}

COOL STUFF BBB

{/if}
{if $categories[cat_num].order_by eq 100}

COOL STUFF CCC

{/if}
{if $categories[cat_num].order_by eq 150}

COOL STUFF DDD

{/if}
<FONT class="CategoriesList">{$categories[cat_num].category}</FONT>

{/section}
{else} {section name=cat_num loop=$subcategories}
<FONT class="CategoriesList">{$subcategories[cat_num].category}</FONT>

{/section}
{/if}
{/if}
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }


IndieDepot 05-22-2005 12:21 PM

Carrie,
Thanks, but it did not work again. However AgileMolecule must have done something different. I guess the quotes on the classes did the trick.

Thanks BCSE & AgileMolecule for getting this to work with 4.0.13:

Carrie this would be a great addition to your FREE area on your wonderful website.

To end this discussion here's the code for everybody using 4.0.13 X-Cart. This should replace your entire /customer/categories.tpl file:

this works fine in 4.0.13 written by BCSE:

Code:

{* $Id: categories.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"}
{else}
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}
{if $categories[cat_num].order_by eq 50 || $categories[cat_num].order_by eq 100 || $categories[cat_num].order_by eq 150}

 --------------------{* NOTE: CHANGE THE LINES TO BE WHAT EVER YOU WANT TO DIVIDE THE CATEGORIES *}
{/if}
<FONT class="CategoriesList">{$categories[cat_num].category}</FONT>
 
{/section}
{else} {section name=cat_num loop=$subcategories}
<FONT class="CategoriesList">{$subcategories[cat_num].category}</FONT>
 
{/section}
{/if}
{/if}
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }


this is a fancier version with custom headings for each section for 4.0.13 created by BCSE & upgraded by AgileMolecule:

Code:

{* $Id: categories.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"}
{else}
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}

{if $categories[cat_num].order_by eq 5}

COOL STUFF AAA
 
{/if}
{if $categories[cat_num].order_by eq 50}

COOL STUFF BBB
 
{/if}
{if $categories[cat_num].order_by eq 100}

COOL STUFF CCC
 
{/if}
{if $categories[cat_num].order_by eq 150}

COOL STUFF DDD
 
{/if}
<FONT class="CategoriesList">{$categories[cat_num].category}</FONT>
 
{/section}
{else} {section name=cat_num loop=$subcategories}
<FONT class="CategoriesList">{$subcategories[cat_num].category}</FONT>
 
{/section}
{/if}
{/if}
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }


- Shannon


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

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