Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Sort Customer Orders Latest First
Author « Topic »  

RayCramblit
Advanced Member

USA
173 Posts

Pre-sales questions only
(More Details...)

Posted - 12/16/2020 :  14:02:03  
Back again with another client request.

My client want to have the customers orders displayed sorted with the latest order on top of the list of orders when a customer logs into their account. She says the latest order now appears at the bottom of the list of orders in the customers view after logging in.

How/where do I change the cart to make the most recent order appear on the top of the customer view list with the list of orders sorted by the order date?

As always, thanks in advance for any help.

Ray Cramblit

Phil
ECT Moderator

United Kingdom
7680 Posts

Posted - 12/16/2020 :  14:13:39  
Hi Ray,
open vsadmin/inc/incclientlogin.php and around line 918

$sSQL="SELECT ordID,ordDate,ordTrackNum,ordTotal,ordStateTax,ordCountryTax,ordShipping,ordHSTTax,ordHandling,ordDiscount," . getlangid('statPublic',64) . " FROM orders LEFT OUTER JOIN orderstatus ON orders.ordStatus=orderstatus.statID WHERE ordStatus<>1 AND ordClientID=" . $_SESSION['clientID'] . " ORDER BY ordDate";

Just add DESC so it reads
" ORDER BY ordDate DESC";



* Database Migrations and Conversions*
* ASP to PHP Cart Conversions*

*Contact Us*
*Buy The PHP Capture Card Plugin*
*Rate Our Services/View Our Feedback*

dbdave
ECT Moderator

USA
10409 Posts

Posted - 12/16/2020 :  14:48:28  
Hi Ray, I know Phil really knows his stuff, and I don't want to contradict his response, and maybe I don't fully understand the questions, but when you list orders in the admin, you can change the sort by clicking any of the headings there.
Click (Date) once for descending and again for ascending.

At least I think that's what you want.

Thanks,
David

Edited by - dbdave on 12/16/2020 14:53:09

Phil
ECT Moderator

United Kingdom
7680 Posts

Posted - 12/16/2020 :  15:04:08  
It was the "when a customer logs into their account" that pointed me in the right direction.



* Database Migrations and Conversions*
* ASP to PHP Cart Conversions*

*Contact Us*
*Buy The PHP Capture Card Plugin*
*Rate Our Services/View Our Feedback*

dbdave
ECT Moderator

USA
10409 Posts

Posted - 12/16/2020 :  15:13:19  
Ahhh... Epic fail on my part..
I guess I just glossed over the question.

Good one.

Thanks,
David

RayCramblit
Advanced Member

USA
173 Posts

Pre-sales questions only
(More Details...)

Posted - 12/16/2020 :  17:49:14  
BIG Thanks Phil!

Someday I'll be as smart as the moderators of this forum!

Ray Cramblit
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000