![]() |
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... |
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); |
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?
|
Re: Add "Customer Orders Totals" to Customer Profile Page
in the php file
its what makes smarty see the variable, hth |
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! |
Re: Add "Customer Orders Totals" to Customer Profile Page
sounds like a good mod, love to see it completed!
|
All times are GMT -8. The time now is 03:20 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.