If this is your first visit, check our documentation. To post, register or login.

Call Order Date plus 5

Started by brandonturpin on 27 May 2013, 1:36 AM · Views: 1,406

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

Post #1 by brandonturpin

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!

**Zen Cart Help and Design**

If you don’t build your dream, someone else will hire you to help them build theirs.

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

kobra

Black Belt

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

Post #2 by kobra

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

Zen-Venom Get Bitten

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

swguy

Administrator

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

Post #3 by swguy

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

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.

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

swguy

Administrator

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

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

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.

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

brandonturpin

Zen Follower

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

Post #5 by brandonturpin

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! :-)

**Zen Cart Help and Design**

If you don’t build your dream, someone else will hire you to help them build theirs.

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

brandonturpin

Zen Follower

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

Post #6 by brandonturpin

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 ));

**Zen Cart Help and Design**

If you don’t build your dream, someone else will hire you to help them build theirs.

28 May 2013, 12:04 AM
#7
swguy avatar

swguy

Administrator

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

Post #7 by swguy

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;

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.