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

Order information from DB to Smarty var?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-28-2009, 06:44 AM
 
lownoma925 lownoma925 is offline
 

Member
  
Join Date: Jun 2009
Posts: 15
 

Default Order information from DB to Smarty var?

Hi,

I'm curious to why I can't seem to have a working if statement while calling {if $order.fedex_tracking ne ""} or {if empty($order.fedex_tracking)}.. do I have to do anything on the PHP side of things in order for this to show? (I'm working with the order message template)

Thanks!

Tom.
__________________
Quote:
Development Server Specs
X-Cart version: 4.4.2
PHP: 5.2.17
GD: bundled (2.0.34 compatible)
MySQL server: 5.0.77
Web server: Apache
Operating system: CentOS 5 Linux
Perl: 5.008008
XML parser: expat
Reply With Quote
  #2  
Old 10-28-2009, 06:48 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default Re: Order information from DB to Smarty var?

is fedex_tracking available in the $order array?

webmaster mode might help, or try printing $order.fedex_tracking somewhere so you can see what value is has, I find this helps when trying to work out why ifs don't work. sometimes the variable value isn't what you expect.

hth
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
  #3  
Old 10-28-2009, 06:52 AM
 
lownoma925 lownoma925 is offline
 

Member
  
Join Date: Jun 2009
Posts: 15
 

Default Re: Order information from DB to Smarty var?

Sorry, I had a lack of understanding of how that worked... It's actually a custom field that our programmers put in that I need to evaluate. So, it needs to be defined in an array?
__________________
Quote:
Development Server Specs
X-Cart version: 4.4.2
PHP: 5.2.17
GD: bundled (2.0.34 compatible)
MySQL server: 5.0.77
Web server: Apache
Operating system: CentOS 5 Linux
Perl: 5.008008
XML parser: expat
Reply With Quote
  #4  
Old 10-28-2009, 06:59 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default Re: Order information from DB to Smarty var?

OK, so you've added it to the database yourself.

However, the php doesn't know that field exists, so it's not returned when the database is queried. In general queries specify exactly which data is needed to keep the size down and the page load quicker.

Your php files will need editing to include this data in the query.

hth
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
  #5  
Old 10-28-2009, 07:04 AM
 
lownoma925 lownoma925 is offline
 

Member
  
Join Date: Jun 2009
Posts: 15
 

Default Re: Order information from DB to Smarty var?

Does it matter where I query the database from or is there a function that does it that can be modified? In earlier instances of the code that I'm modifying has the same if statement and it used to work at one time, but I'm guessing someone modified the query and broke the if statement? Hence the reason it doesn't work anymore? Now I've been told to change it and still am young in my PHP and Smarty days - but eager to learn.
__________________
Quote:
Development Server Specs
X-Cart version: 4.4.2
PHP: 5.2.17
GD: bundled (2.0.34 compatible)
MySQL server: 5.0.77
Web server: Apache
Operating system: CentOS 5 Linux
Perl: 5.008008
XML parser: expat
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 10:22 AM.

   

 
X-Cart forums © 2001-2020