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

Access to smarty variable $current_category

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-03-2011, 05:10 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default Access to smarty variable $current_category

Hello ...

Within version 4.1.x I was able to access the $current_category smarty variable when I was viewing the products detail page (product.php)

I can no longer do this with 4.4.x. Can anyone help on which .php files I have to make changes to in order for me to access to this smarty variable?

Many Thanks & Regards

Shafiq :sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #2  
Old 04-03-2011, 07:11 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Access to smarty variable $current_category

Try

$current_category = func_get_category_data($cat);
$smarty->assign("current_category, $current_category);

in product.php

You may need to load "categories" and define $cat if not available ($cat will be the product category)
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
chamberinternet (04-03-2011)
  #3  
Old 04-03-2011, 11:04 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default Re: Access to smarty variable $current_category

Thanks Steve ... That worked great

Regards

Shafiq :sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 08:31 AM.

   

 
X-Cart forums © 2001-2020