| 
 | ||||||||||
|  | Shopping cart software Solutions for online shops and malls | |||||||||
|  |  |  | ||||||||
| X-Cart Home |  FAQ |  Forum rules |  Calendar |  Mark Forums Read |  User manuals |  Login | 
|  | 
| Add "Customer Orders Totals" to Customer Profile Page | |||
|  |  | ||
|  | Thread Tools | Search this Thread | 
| 
			 
			#1  
			
			
			
			
		 | |||||||
| 
 | |||||||
|  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 | |||||||
| 
			 
			#2  
			
			
			
			
		 | |||||||
| 
 | |||||||
|  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: 
 Now the variable $TotalCustomer contains the amount. Next up, you need to pass that info to smarty via code similar to this: Code: 
 | |||||||
| 
			 
			#3  
			
			
			
			
		 | |||||||
| 
 | |||||||
|  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 | |||||||
| 
			 
			#4  
			
			
			
			
		 | |||||||||
| 
 | |||||||||
|  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! | |||||||||
| 
			 
			#5  
			
			
			
			
		 | |||||||
| 
 | |||||||
|  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 | |||||||
| 
			 
			#6  
			
			
			
			
		 | |||||||||
| 
 | |||||||||
|  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! | |||||||||
|  |  | 
| Thread Tools | Search this Thread | 
| 
 | 
 | 
|  | |||
| 
X-Cart forums © 2001-2020
 | |||