Zen Cart Logo
Forums / Customization from the Admin / Call Order Date plus 5

Call Order Date plus 5

Views: 1,385

Results 1 to 7 of 7
27 May 2013, 1:36 AM
#1
brandonturpin avatar

brandonturpin

Zen Follower

Join Date:
Dec 2008
Location:
Utah, USA
Posts:
183
Plugin Contributions:
7

Call Order Date plus 5

This is probably something simple I am overlooking, I have a client that wants to show the order date +5 in the admin. I have found where it calls the order date in the admin in control/orders.php

<td class="dataTableContent" align="center"><?php echo zen_datetime_short($orders->fields['date_purchased']); ?></td>

Now I need to take that date purchased and add 5 days to it. I know this is completely wrong but something like

$ordered_date = zen_datetime_short($orders->fields['date_purchased']);
$ordered_date_plus_five = $ordered_date+5;

I know that is far from correct and I need to pull out the day of the date but just so you get the idea.. then I can call the $ordered_date_plus_five in the loop

Any help would be nice!
Thanks in advance!

27 May 2013, 4:44 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Call Order Date plus 5

order date in the admin in control/orders.php
There is no folder named "control" is a default distribution
Where/what created this?

27 May 2013, 5:13 PM
#3
swguy avatar

swguy

Administrator

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

Re: Call Order Date plus 5

I think "control" is his renamed admin panel. But remember that this is supposed to be a secret!

27 May 2013, 5:14 PM
#4
swguy avatar

swguy

Administrator

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

Re: Call Order Date plus 5

@Brandon, Prior to calling zen_datetime_short, you should be adding 5 days to $orders->fields['date_purchased'].

(5 * 24 * 60 * 60 is 5 days in seconds.)

27 May 2013, 6:30 PM
#5
brandonturpin avatar

brandonturpin

Zen Follower

Join Date:
Dec 2008
Location:
Utah, USA
Posts:
183
Plugin Contributions:
7

Re: Call Order Date plus 5

swguy:

I think "control" is his renamed admin panel. But remember that this is supposed to be a secret!

Ha good thing its just a test environment! :-)

swguy:

@Brandon, Prior to calling zen_datetime_short, you should be adding 5 days to $orders->fields['date_purchased'].

(5 * 24 * 60 * 60 is 5 days in seconds.)

I am having troubles adding 5 days to the $orders->fields['date_purchased']); any ideas how I would add to this?!?

Thanks in advance for the help! :-)

27 May 2013, 8:16 PM
#6
brandonturpin avatar

brandonturpin

Zen Follower

Join Date:
Dec 2008
Location:
Utah, USA
Posts:
183
Plugin Contributions:
7

Re: Call Order Date plus 5

Got it!!

For those that need to know (although I am not sure if any will)

$order_date_plus_five = zen_datetime_short(date('Y-m-d H:i:s', strtotime($orders->fields['date_purchased']) + 5 * 24 * 3600 ));
28 May 2013, 12:04 AM
#7
swguy avatar

swguy

Administrator

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

Re: Call Order Date plus 5

Note that another way to do this would be to do it as part of the database query.

SELECT date_add(date_purchased, INTERVAL 5 DAY) AS dayplus5 FROM orders;