If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / My Account >Previous Orders

My Account >Previous Orders

Started by traytray on 13 Feb 2013, 5:01 AM · Views: 2,096

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

traytray

Totally Zenned

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

Post #1 by traytray

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, 5:45 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #2 by drbyte

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

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

13 Feb 2013, 6:01 AM
#3
traytray avatar

traytray

Totally Zenned

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

Post #3 by traytray

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!

1 Oct 2020, 2:27 PM
#4
techiant avatar

techiant

New Zenner

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

Post #4 by 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!

**Case Badges** by Techiant

1 Oct 2020, 3:18 PM
#5
carlwhat avatar

carlwhat

zennedOut

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

Post #5 by carlwhat

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.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

1 Oct 2020, 3:18 PM
#6
simon1066 avatar

simon1066

Totally Zenned

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

Post #6 by simon1066

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)

Simon

1 Oct 2020, 3:27 PM
#7
techiant avatar

techiant

New Zenner

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

Post #7 by 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!

**Case Badges** by Techiant

2 Oct 2020, 4:30 AM
#8
davewest avatar

davewest

Totally Zenned

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

Post #8 by davewest

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...

Dave
Always forward thinking... Lost my mind!

2 Oct 2020, 5:55 AM
#9
techiant avatar

techiant

New Zenner

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

Post #9 by techiant

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

**Case Badges** by Techiant

2 Oct 2020, 4:10 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #10 by drbyte

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.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 Oct 2020, 1:02 AM
#11
swguy avatar

swguy

Administrator

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

Post #11 by swguy

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!

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.