Zen Cart Logo
Forums / General Questions / My Account >Previous Orders

My Account >Previous Orders

Views: 2,086

Results 1 to 11 of 11
13 Feb 2013, 05:01
#1
traytray avatar

traytray

Totally Zenned

Join Date:
May 2012
Posts:
566
Plugin Contributions:
0

My Account >Previous Orders

I made up 4 test orders, and now under My Account Information >Previous Orders, I see 3 of those 4 listed. I almost missed the (show all orders) in the upper right corner, because it's so small and out of the way (how can I modify that?). I think 4 or 5 Previous Orders would be a better number, and then I would send a customer off to see their entire order history.

I checked Admin, but couldn't find where I had Previous Orders so I could change it.

Thank You.

13 Feb 2013, 05:45
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: My Account >Previous Orders

Change the number in /includes/modules/pages/account/header_php.php:```
ORDER BY orders_id DESC [B]LIMIT 3[/B]";

13 Feb 2013, 06:01
#3
traytray avatar

traytray

Totally Zenned

Join Date:
May 2012
Posts:
566
Plugin Contributions:
0

Re: My Account >Previous Orders

Changed it to 5 and I couldn't get My Account to open at all. Changed it back to 3 and I still can't get My Account to open.

UPDATE: I deleted the file and inserted fresh from back up and again made the change. It is now working fine. I have no idea what happened.Thanks!

01 Oct 2020, 14:27
#4
techiant avatar

techiant

New Zenner

Join Date:
Oct 2008
Posts:
82
Plugin Contributions:
0

Re: My Account >Previous Orders

Is there a soft or hard-coded configuration that I can set to change the number of the Previous Orders displayed under My Account from the default 3 orders?
I looked at the tpl_account_default.php but it simply loops through the array already loaded foreach($ordersArray as $orders).

I am aware that I can access (and configure max number), under Show All Orders - that's not what I'm looking for.

Thanks!

01 Oct 2020, 15:18
#5
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: My Account >Previous Orders

Techiant:

Is there a soft or hard-coded configuration that I can set to change the number of the Previous Orders displayed under My Account from the default 3 orders?
I looked at the tpl_account_default.php but it simply loops through the array already loaded foreach($ordersArray as $orders).

I am aware that I can access (and configure max number), under Show All Orders - that's not what I'm looking for.

Thanks!

you did not mention what version of ZC you are using.

for v157, look here:

https://github.com/zencart/zencart/blob/6f692bf6fb217815d4d7328f8b7aed86c34cf8eb/includes/modules/pages/account/header_php.php#L34-L45

line 45 says limit 3.

change that number to whatever number you would like.

best.

01 Oct 2020, 15:18
#6
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: My Account >Previous Orders

Echoing one of the posts above:
It appears the number of orders displayed on the customer's account page is set by this line:

ORDER BY orders_id DESC LIMIT 3";

in

\includes\modules\pages\account\header_php.php

(for ZC v1.56c)

01 Oct 2020, 15:27
#7
techiant avatar

techiant

New Zenner

Join Date:
Oct 2008
Posts:
82
Plugin Contributions:
0

Re: My Account >Previous Orders

Thanks, CarlWhat and Simon. Of course, forgot to look in the header! Worked as expected. Devs should probably consider putting this in Config.

Cheers!

02 Oct 2020, 04:30
#8
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: My Account >Previous Orders

Techiant:

Thanks, CarlWhat and Simon. Of course, forgot to look in the header! Worked as expected. Devs should probably consider putting this in Config.

Cheers!
You could take the split page code from account_history header and tpl file to account header and tpl, do the split page there... than the list max setting for history would also work for account order list... Admin-> maximum values-> customer order history list per page.. Of course if you do all that then you could just add your own maximum setting too... customer account order list per page... lest, that's what I did..
Attachment 19224

Just a thought...

02 Oct 2020, 05:55
#9
techiant avatar

techiant

New Zenner

Join Date:
Oct 2008
Posts:
82
Plugin Contributions:
0

Re: My Account >Previous Orders

I could. I just think hardcoded 3 would be better off as configurable in general.

02 Oct 2020, 16:10
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: My Account >Previous Orders

Techiant:

I could. I just think hardcoded 3 would be better off as configurable in general.

Why? Do we really need MORE admin configuration switches that people complain are already too many?

If 3 isn't a reasonable default, what is a better one and why?

Remember: about 25 pixels above the list of 3 is a link to click to see entire order history! And that page already has pagination, too.

03 Oct 2020, 01:02
#11
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: My Account >Previous Orders

Every setting in the admin is an aspect you can change in your store without needing to modify code.

AND

Every setting in the admin panel increases the cognitive load on the storeowner who's trying to figure out which setting needs to be updated to get the behavior they want.

It's a tricky balance!