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

Add "Customer Orders Totals" to Customer Profile Page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-30-2010, 08:20 AM
 
kmjperformance kmjperformance is offline
 

Advanced Member
  
Join Date: Jul 2008
Location: Iowa
Posts: 42
 

Question Add "Customer Orders Totals" to Customer Profile Page

If something like this has been covered, I apologize, I searched and didn't find anything...

I'm looking for a way to add a field visible only to non-customers that shows the total number of Processed, Failed, etc... orders the customer has placed with us.

I know the SQL and I already added a function to the include/func/func.db.php file that calculates these (GetOrderCounts($CustLogin)). It returns the total count of the different types of orders.

However I can't figure out how to display this on the page!

Really scratching my head here.


Thanks in advance!

P.S. If I get this to work, I'm planning on adding a customer total YTD $, MTD $, etc...
__________________

X-Cart 4.4.5
PHP 5.3.14-1
MySQL 5.0.51
Linux + Apache
Mods:
AlteredCart SmartSearch w/ AJAX Predictive Search w/ Extras Add-On v2, BuyTogether, Checkout One, OnSale
********* PowerFilter
WebsiteCM CDSEOPro
Phpmagicscripts Reviews-Controller
CFL Systems Products Page Layout, System Messages mod
Custom work by CFLSystems
Custom work by us
Reply With Quote
  #2  
Old 10-30-2010, 02:36 PM
 
Shamun Shamun is offline
 

X-Adept
  
Join Date: Jun 2009
Location: North Carolina
Posts: 841
 

Default Re: Add "Customer Orders Totals" to Customer Profile Page

In the PHP you need to have the logic that gets the amount. It seems you have that, which is accessed by the function GetOrderCounts($CustLogin) where $CustLogin is an autopopulated variable.

If not, you will need something like this:
Code:
$TotalCustomer = GetOrderCounts($CustLogin);

Now the variable $TotalCustomer contains the amount. Next up, you need to pass that info to smarty via code similar to this:
Code:
$smarty->assign('varNameYouWantToUseInSmarty', $TotalCustomer);
__________________
- Shane Munroe
Reply With Quote
  #3  
Old 11-01-2010, 06:24 AM
 
kmjperformance kmjperformance is offline
 

Advanced Member
  
Join Date: Jul 2008
Location: Iowa
Posts: 42
 

Default Re: Add "Customer Orders Totals" to Customer Profile Page

So, do I put the $smarty->assign() code in the "include/func/func.db.php" file, or in the smarty template, or do I put it in some other file?
__________________

X-Cart 4.4.5
PHP 5.3.14-1
MySQL 5.0.51
Linux + Apache
Mods:
AlteredCart SmartSearch w/ AJAX Predictive Search w/ Extras Add-On v2, BuyTogether, Checkout One, OnSale
********* PowerFilter
WebsiteCM CDSEOPro
Phpmagicscripts Reviews-Controller
CFL Systems Products Page Layout, System Messages mod
Custom work by CFLSystems
Custom work by us
Reply With Quote
  #4  
Old 11-01-2010, 06:32 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

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

Default Re: Add "Customer Orders Totals" to Customer Profile Page

in the php file

its what makes smarty see the variable,

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 11-01-2010, 07:44 AM
 
kmjperformance kmjperformance is offline
 

Advanced Member
  
Join Date: Jul 2008
Location: Iowa
Posts: 42
 

Default Re: Add "Customer Orders Totals" to Customer Profile Page

Got it!

Thanks everyone!

I'll be using this a lot. Once I get something I feel is useful, I'll post the code on here.

Thanks again!
__________________

X-Cart 4.4.5
PHP 5.3.14-1
MySQL 5.0.51
Linux + Apache
Mods:
AlteredCart SmartSearch w/ AJAX Predictive Search w/ Extras Add-On v2, BuyTogether, Checkout One, OnSale
********* PowerFilter
WebsiteCM CDSEOPro
Phpmagicscripts Reviews-Controller
CFL Systems Products Page Layout, System Messages mod
Custom work by CFLSystems
Custom work by us
Reply With Quote
  #6  
Old 11-01-2010, 10:06 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

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

Default Re: Add "Customer Orders Totals" to Customer Profile Page

sounds like a good mod, love to see it completed!
__________________
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
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:46 AM.

   

 
X-Cart forums © 2001-2020