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

Smarty Variable List/Guide

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-18-2010, 06:40 PM
 
petrero petrero is offline
 

Newbie
  
Join Date: Dec 2007
Posts: 4
 

Default Smarty Variable List/Guide

I'm back under the hood working on the sites again, and in need of a list of smarty variables that x-cart uses. I could have sworn that there was a guide/list/tutorial here on the forums at some point, but try as I might I haven't been able to find it. Can anyone assist?

Much thanks as always.

Peter
Reply With Quote
  #2  
Old 12-18-2010, 07:19 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Smarty Variable List/Guide

Your best bet is to use the webmaster mode console to see all the smarty variables and their settings per page load.

For your version - the smarty variables are not present by default in webmaster mode.

This tip explains what to do to see them.

This thread contains a method to modify it so your webmaster mode can switch between template listing and smarty variables.

---
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #3  
Old 12-18-2010, 07:29 PM
 
petrero petrero is offline
 

Newbie
  
Join Date: Dec 2007
Posts: 4
 

Default Re: Smarty Variable List/Guide

Thanks so much, gb. I'll look into the modification. Although embarassing, it might make sense to ask about a particular variable:

On my product page, I'm trying to create a breadcrumb - so I need to display the category related to that particular product. I could not find it in the $product array. Any thoughts?
Reply With Quote
  #4  
Old 12-18-2010, 08:22 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Smarty Variable List/Guide

If you are assigning an individual product to many categories - to my knowledge, the default installation of X-Cart does not query for every possible category in which a product can be and provide that in smarty.

In the product array - you are provided with what you what you have set to be the Main category. That is what X-Cart uses to build its breadcrumb. (It is not a true navigation breadcrumb that traces how you navigated to the product page.)

So, when you say "the category related to that particular product", it is unclear what you mean. If you mean the main category - it should be in the product array. If you mean something else - it might not be available by default in smarty.

---
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #5  
Old 12-18-2010, 08:34 PM
 
petrero petrero is offline
 

Newbie
  
Join Date: Dec 2007
Posts: 4
 

Default Re: Smarty Variable List/Guide

sorry... should have been more clear. each product is assigned/associated with only one parent category. within the $product array, I'm only finding the category ID. I guess I could do an if/then statement, like if catid=950 then display 'eye brushes'. prefer something a bit cleaner, but it may have to do.

hmm.... :\
Reply With Quote
  #6  
Old 12-18-2010, 09:01 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Smarty Variable List/Guide

If the information you need is not there - then you have to add a query to the php to get it.

The query that got the catid can be modified to also get the name.

Are you sure it is not there? The default x-cart installation already has a breadcrumb that has the name. I also thought there was a $current_category array with the information.

If you look at the tips I originally posted, you should be able to search in the webmaster mode for these variables.

---
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
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 02:54 AM.

   

 
X-Cart forums © 2001-2020