Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

$cat.category..........desc?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #31  
Old 09-08-2009, 06:14 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: $cat.category..........desc?

You are trying to list more then one category - currect_category is just what it says and applies to currect category you are in and is only one category. This {foreach from=$current_category item=cat} will list individual properties under currect category and nothing else. Not sure yet where are you trying all of this and what variable are available. Try this
{foreach from=$categories key=c item=i}
$i.category : $i.description
{/foreach}
but looking at your debug file attached here you still don't have description included in categories arrays. You need to edit php file and include it
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
cowsdonthack (09-08-2009)
  #32  
Old 09-08-2009, 06:20 AM
  cowsdonthack's Avatar 
cowsdonthack cowsdonthack is offline
 

Advanced Member
  
Join Date: May 2009
Location: Out in the field. Chewin some grass
Posts: 89
 

Default Re: $cat.category..........desc?

Quote:
Originally Posted by cflsystems
You are trying to list more then one category - currect_category is just what it says and applies to currect category you are in and is only one category. This {foreach from=$current_category item=cat} will list individual properties under currect category and nothing else. Not sure yet where are you trying all of this and what variable are available. Try this
{foreach from=$categories key=c item=i}
$i.category : $i.description
{/foreach}
but looking at your debug file attached here you still don't have description included in categories arrays. You need to edit php file and include it

Oh sorry about that, it's on the home_list.tpl which loads up in the home page. Ashley has the code working on his website.

The debug file attached is when you go into the category which is where the variable was original taken from and is working. But it doesn't work in home_list.tpl

Very sorry about that confusion.

---
Update
---

I tried changing the code you mentioned. What php did you think I should edit and include.

When I changed the code I realized it was also pulling up another variable and displaying it. Which was Category.

So that's neat, it can display the ID and the Category as well. But not the description? How do we make the array begin from Current_Category?
Attached Files
File Type: tpl home_list.tpl (6.4 KB, 84 views)
__________________
Moo?
Quality Door & Hardware

Version
X-Cart 4.1.108

Add-ons
X-AOM (Advanced Order Management)
Ad / Banner X-cart Mod (BCSE)
DSEFU
Dynamic Image Mod
Pre-login Shipping Calculator
Power Filter
Contact Us Form
Shipping Carrier Mod
Submit Button

Send me a message, I can talk about anything.
Reply With Quote
  #33  
Old 09-08-2009, 06:28 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: $cat.category..........desc?

This is part of the debug window
Code:
{$categories} Array (14) 155 => Array (11) parentid => "0" categoryid_path => "155" category => "Access Control Hardware" avail => "Y" order_by => "0" subcategory_count => "4" product_count => "59" is_icon => "Y" image_path => "./images/C/01.gif" categoryid => 155 icon_url => "http://www.qualitydoor.com/images/C/0..." 9 => Array (11) parentid => "0" categoryid_path => "9" category => "Bathroom Accessories" avail => "Y" order_by => "0" subcategory_count => "16" product_count => "173" is_icon => "Y"
as you can see there is no description in categories arrays. Edit php file as posted earlier so you can get the descr to show in arrays, then you will be able to access it
I assume you are trying to get this code to work
Code:
<div class="bot_cat" align="left"> {foreach from=$categories item=cat} <a class="bot_products" href="home.php?cat={ $cat.categoryid }"><img src="{$xcart_web_dir}/image.php?id={ $cat.categoryid }&amp;type=C" alt="" />{ $cat.categoryid } </a>{/foreach} </div>
after you edit the php file and have descr in cat arrays they yes it will be {$cat.description} inside that code
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
cowsdonthack (09-08-2009)
  #34  
Old 09-08-2009, 06:34 AM
  cowsdonthack's Avatar 
cowsdonthack cowsdonthack is offline
 

Advanced Member
  
Join Date: May 2009
Location: Out in the field. Chewin some grass
Posts: 89
 

Default Re: $cat.category..........desc?

Quote:
Originally Posted by cflsystems
This is part of the debug window
Code:
{$categories} Array (14) 155 => Array (11) parentid => "0" categoryid_path => "155" category => "Access Control Hardware" avail => "Y" order_by => "0" subcategory_count => "4" product_count => "59" is_icon => "Y" image_path => "./images/C/01.gif" categoryid => 155 icon_url => "http://www.qualitydoor.com/images/C/0..." 9 => Array (11) parentid => "0" categoryid_path => "9" category => "Bathroom Accessories" avail => "Y" order_by => "0" subcategory_count => "16" product_count => "173" is_icon => "Y"
as you can see there is no description in categories arrays. Edit php file as posted earlier so you can get the descr to show in arrays, then you will be able to access it
I assume you are trying to get this code to work
Code:
<div class="bot_cat" align="left"> {foreach from=$categories item=cat} <a class="bot_products" href="home.php?cat={ $cat.categoryid }"><img src="{$xcart_web_dir}/image.php?id={ $cat.categoryid }&amp;type=C" alt="" />{ $cat.categoryid } </a>{/foreach} </div>
after you edit the php file and have descr in cat arrays they yes it will be {$cat.description} inside that code

Thank you so much for bringing that up, I didn't even know that the webmaster mode was giving me ALL the variables for each thing, that's very helpful

But when you mean editing the PHP file did you mean -->
func.category.php
categories.php
or the index or home_list?
__________________
Moo?
Quality Door & Hardware

Version
X-Cart 4.1.108

Add-ons
X-AOM (Advanced Order Management)
Ad / Banner X-cart Mod (BCSE)
DSEFU
Dynamic Image Mod
Pre-login Shipping Calculator
Power Filter
Contact Us Form
Shipping Carrier Mod
Submit Button

Send me a message, I can talk about anything.
Reply With Quote
  #35  
Old 09-08-2009, 06:39 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: $cat.category..........desc?

See earlier posts. categories.php probably but just read through the thread
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
cowsdonthack (09-08-2009)
  #36  
Old 09-08-2009, 06:52 AM
  cowsdonthack's Avatar 
cowsdonthack cowsdonthack is offline
 

Advanced Member
  
Join Date: May 2009
Location: Out in the field. Chewin some grass
Posts: 89
 

Default Re: $cat.category..........desc?

Quote:
Originally Posted by Ashley
this worked. {$cat.description}

http://www.arwvisions.com/test2/xcart/

Hey, Ashley, if there's no problem with it, could you attach your categories.php to me? I'm going to compare it to the one that I have. And since I know the one you have is working, it would really help.
__________________
Moo?
Quality Door & Hardware

Version
X-Cart 4.1.108

Add-ons
X-AOM (Advanced Order Management)
Ad / Banner X-cart Mod (BCSE)
DSEFU
Dynamic Image Mod
Pre-login Shipping Calculator
Power Filter
Contact Us Form
Shipping Carrier Mod
Submit Button

Send me a message, I can talk about anything.
Reply With Quote
  #37  
Old 09-08-2009, 08:44 AM
  cowsdonthack's Avatar 
cowsdonthack cowsdonthack is offline
 

Advanced Member
  
Join Date: May 2009
Location: Out in the field. Chewin some grass
Posts: 89
 

Default Re: $cat.category..........desc?

Quote:
Originally Posted by cflsystems
See earlier posts. categories.php probably but just read through the thread

DER SUCCESS!

THANK YOU CFL and Ashley! Yeah, so I went into the categories.php I don't know if this was modified but you were absolutely right. I cross referenced with what Ashley said, and figured that it had nothing to do with the home_list page.

These were the exact lines that needed to be changed.

Code:
if ($short_list) { $to_search = "$sql_tbl[categories].categoryid,$sql_tbl[categories].parentid,$sql_tbl[categories].categoryid_path,$sql_tbl[categories].category,$sql_tbl[categories].avail,$sql_tbl[categories].order_by"; } else { $to_search = "$sql_tbl[categories].*"; }

with

Code:
if ($short_list) { $to_search = "$sql_tbl[categories].categoryid,$sql_tbl[categories].parentid,$sql_tbl[categories].categoryid_path,$sql_tbl[categories].category,$sql_tbl[categories].description,$sql_tbl[categories].avail,$sql_tbl[categories].order_by"; } else { $to_search = "$sql_tbl[categories].*"; }

I'm sorry if I wasn't listening clearly in the beginning.

Thank you once again guys!
__________________
Moo?
Quality Door & Hardware

Version
X-Cart 4.1.108

Add-ons
X-AOM (Advanced Order Management)
Ad / Banner X-cart Mod (BCSE)
DSEFU
Dynamic Image Mod
Pre-login Shipping Calculator
Power Filter
Contact Us Form
Shipping Carrier Mod
Submit Button

Send me a message, I can talk about anything.
Reply With Quote
  #38  
Old 09-08-2009, 08:57 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: $cat.category..........desc?

DERRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR!!!!! glad you got it!!
__________________
xcart 5.1.2
Reply With Quote

The following user thanks ARW VISIONS for this useful post:
cowsdonthack (09-09-2009)
  #39  
Old 09-08-2009, 09:15 AM
  cowsdonthack's Avatar 
cowsdonthack cowsdonthack is offline
 

Advanced Member
  
Join Date: May 2009
Location: Out in the field. Chewin some grass
Posts: 89
 

Default Re: $cat.category..........desc?

derrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrr
__________________
Moo?
Quality Door & Hardware

Version
X-Cart 4.1.108

Add-ons
X-AOM (Advanced Order Management)
Ad / Banner X-cart Mod (BCSE)
DSEFU
Dynamic Image Mod
Pre-login Shipping Calculator
Power Filter
Contact Us Form
Shipping Carrier Mod
Submit Button

Send me a message, I can talk about anything.
Reply With Quote
  #40  
Old 09-08-2009, 10:09 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: $cat.category..........desc?

Keep on reading, you will get a lot more
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
cowsdonthack (09-09-2009)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:21 PM.

   

 
X-Cart forums © 2001-2020