Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shipdate contribution (shipping arrival date)


Guest

Recommended Posts

Hi all

 

Any change that someone has managed to change/add a calendar week instead of month.

 

ie: choose and click between two hours.

 

Just like one of those beautiful option that one sees in a food shopping online. option to bood a delivery time..

 

if not, is there someone ready to help me in making it?

Link to comment
Share on other sites

  • 2 weeks later...

Hi all,

 

I have installed the contribution in my ms2 and works very very well

as far as delivery date only in concern...

 

I have the need to show ONLY, 7 days in the CALENDAR starting as from days'date in order to split the day in 7 slots.

 

I have been trying to do it myself, but I guess I am not good enough.

 

I really would appreciate if someone with the knowledge of the calendar could help in this one.

 

I know that "Matt Plummer" has an inside knowledge but I would want to be a pain in emailing him directly. ( However, Matt if you have some free time, I would appreciate some help )

Link to comment
Share on other sites

Hi,

I have installed the contribution in my ms1 and I just recieved the date of thursday, january 1 1970 for all shipdates on all orders in accounthistory.

 

The second problem is i modifed the catalog\includes\classes\calendar.php to get the days and months in german but it works only in calendar.

 

The rest (ie. in mails, confirmation.php) is still in english.

 

need help :o

 

 

Thanks

Link to comment
Share on other sites

  • 4 months later...

:D I have installed v0.2 on MS1 and it works great I have made it so the packingslip and invoice show requested arrival date. Thank you very much for this customers have been asking for this for.

 

I would however like to add this field in the Manual Order contrib "/admin/edit_orders.php". we take phone orders and ebay orders. so now their packingslips and invoices show Dec 31, 1969.

Could someone piont me in the right direction to make this happen? what files do I edit and what files should I get the code from?

Or is there a way I can make the field not show up if it was not entered?

 

Thanks

Link to comment
Share on other sites

:blink: Here is the code I added to admin/packingslip.php and admin/invoice.php to make them show the date if it is set and not if not. you might need to change $order->info['shipdate'] back to the default.

     <?php
     if ($order->info['shipdate'] > 1 ) {
?>
           <td class="main"><b><?php echo TEXT_ARRIVAL_DATE; ?></b></td>
    	 </tr>
       <tr>
            <td class="main"><?php echo date("l, F j, Y",$order->info['shipdate']); ?></td>
        </tr>
    	 <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    	 </tr>
<?php
}
?>

 

I would like to find out if it can be optional instead of maditory on check out.

Link to comment
Share on other sites

  • 3 weeks later...

Tried this, but it doesn't seem to be working?

 

Isn't showing shipdate, or anything for that matter. With teh "echo" it should at least show "TEXT_ARRIVAL_DATE" or something.

Link to comment
Share on other sites

I solved the mystery of the shipdate not being visible in the admin orders page.

 

in admin/includes/classes/orders.php

 

add on line the word "shipdate" 27

 

currency, currency_value, date_purchased, orders_status, last_modified, shipdate from " .

 

and on line 67 add to the delivery array

 

'shipdate' => $order['shipdate'],

 

and then it will work. These are the same changes that came with the orders.php page that is in the catalog includes folder (although you can't just copy that page as there is a lot of other stuff that is different).

This did not seem to work for me. Any ideas?

I'm looking for it to show the shipdate (delivery date) on the invoice. What am I missing here?

Link to comment
Share on other sites

  • 5 months later...

Hi,

 

Reading this thread - the contribution looks like something I need, however rather that delivery - it would be great to alter (or toggle) the text to indicate these are store pickup times.

 

i.e.

 

What date/time would you like to pick up your order, we have the following collection windows to choose from.

 

Any takers to how this may work?

 

Regards

Michael

Link to comment
Share on other sites

  • 3 months later...

Not sure if anyone is still around that could help with this but I'm asking anyway! :D

 

Got it up and going, everything is working well except I, also, cannot see the information on a packing slip or invoice. The packing slip is the most important so I started there and added:

 

<tr>

<td class="main"><b><?php echo TEXT_ARRIVAL_DATE; ?></b></td>

<td class="main"><?php echo date("l, F j, Y",$order->info['shipdate']); ?></td>

</tr>

 

And on my packing slip I get:

 

TEXT_ARRIVAL_DATE Wednesday, December 31, 1969

 

 

I'm pretty sure I didn't set the arrival date as 12-31-69!

Any ideas? Please? Pretty please??

(is begging acceptable here?)

 

Thanks,

Gayla

Link to comment
Share on other sites

In admin/invoice.php (packingslip.php should work as well) around line 140 (or where you wish shipdate to appear) add:

 

<?php //M
   if (isset($order->delivery['shipdate'])){
?>
     <tr>
        <td class="main"><b><?php echo TEXT_ARRIVAL_DATE; ?></b></td>
     </tr>
     <tr>
        <td class="main"><?php echo strftime("%A, %d. %B %Y",$order->delivery['shipdate']);?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
     </tr>
<?php
   }
?>    

 

Make sure changes were being made in admin/classes/order.php as already posted before:

in admin/includes/classes/orders.php

 

add on line the word "shipdate" 27

 

currency, currency_value, date_purchased, orders_status, last_modified, shipdate from " .

 

and on line 67 add to the delivery array

 

'shipdate' => $order['shipdate'],

 

and then it will work. These are the same changes that came with the orders.php page that is in the catalog includes folder (although you can't just copy that page as there is a lot of other stuff that is different).

 

additionally around line 180 in function cart () add to the delivery array

 

'shipdate' => $_SESSION['shipdate'],

 

This worked for me. Hope that does it for you ;-)

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...

Hi everybody!

 

This contribition works fine for me but as I'm french I would like to have the date displayed that way : 15 d?cembre 2004 for french pages and decembre 15, 2004 for the english pages....

 

Can anyone help me fix this pb?

 

Thanks in advance! :rolleyes:

OSC2.2

Link to comment
Share on other sites

Hi, thanks for a great contrib.

 

I have installed it on the latest OSC and seem ok, but when i click on to select a arrival date on the calendar, my SSL url change from

https://secure.sslsite.com/~domain.com to https://secure.atanium.com/~admin2

 

which my server is disabled this style

"Sorry, but this style of domain preview has been disabled.

Instead, you will need to use: http://secure.sslsite.com/~yourdomain.com ""

 

I looked at the calendar.php file and not sure why does it change to "/~adminX"

 

Please help!!

 

Thanks.

Vina

 

 

Hello,

I've just posted a new contribution, my first!

Shipdate v0.1

http://www.oscommerce.com/community/contributions,1393

This contribution adds the capability to specify the date that customers' shipments should arrive on.

Specific features include: 

-Configuration of earliest day for delivery based on date/time of an order.

-Valid days for delivery are displayed and selected on a dynamic PHP calendar on the checkout_shipping page.

-Prior to final order confirmation and processing, the program checks to see if the shipdate is still valid. 

(in case somebody leaves their computer on one screen for days)

-Storage of the information in the database and display on all standard screens.

If you install this contribution it will make the selection of an arrival date mandatory with each order.

REQUIREMENTS:

-PHP 4.1.0 and up, for this initial version I used the $_SESSION variable.  Sorry!  I'll try to fix things up later.

-OSCommerce MS1... with no prior mods involving the files I use here, unless you want to edit manually.

Link to comment
Share on other sites

  • 3 weeks later...
Need to adjust this to not show holidays or other days where there can be no delivery. How can I adjust this?

 

Here's a workaround that did it for me for those who want to display special days (eg. holidays) as valid or non-valid days concerning delivery:

 

In shipsched.php find the following piece of code and modify it according to your needs. This is an example of the 2004 holidays in Germany, which where valid delivery days in our case:

 

function DateInfo($datestamp){
 //This functions returns an array containing info about whether a date is valid for delivery
 //and the CSS class for the calendar.  The classes are defined in calendar.css

 //Currently Sunday is considered invalid and Saturday is a different class, 
 //although for now its class is defined the same as other valid days.
 
//special days (holidays) construct an array of timestamps valid for a special day   to appear "valid"
 //2004: these dates must be modified each year  (format JJJJ-MM-TT):

 $neujahr = "2004-01-01";
 $rosenmontag = "2004-02-23";
 $karfreitag = "2004-04-09";
 $ostermontag = "2004-04-12";
 $tag_der_arbeit = "2004-05-01";
 $christi_himmelfahrt ="2004-05-20";
 $pfingstmontag = "2004-05-31";
 $fronleichnam = "2004-06-10";
 $tag_der_deutschen_einheit = "2004-10-03";
 $allerheiligen = "2004-11-01";
 $heiligabend = "2004-12-24";
 $weihnachtstag_erster = "2004-12-25";
 $weihnachtstag_zweiter = "2004-12-26";
 $silvester = "2004-12-31";
  //Ende eintragen
 
 //change date to timestamp
 $neujahr_stamp = strtotime ($neujahr);
 $rosenmontag_stamp = strtotime ($rosenmontag);
 $karfreitag_stamp = strtotime ($karfreitag);
 $ostermontag_stamp = strtotime ($ostermontag);
 $tag_der_arbeit_stamp = strtotime ($tag_der_arbeit);
 $christi_himmelfahrt_stamp = strtotime ($christi_himmelfahrt);
 $pfingstmontag_stamp = strtotime ($pfingstmontag);
 $fronleichnam_stamp = strtotime ($fronleichnam);
 $tag_der_deutschen_einheit_stamp = strtotime ($tag_der_deutschen_einheit);
 $allerheiligen_stamp = strtotime ($allerheiligen);
 $heiligabend_stamp = strtotime ($heiligabend);
 $weihnachtstag_erster_stamp = strtotime ($weihnachtstag_erster);
 $weihnachtstag_zweiter_stamp = strtotime ($weihnachtstag_zweiter);
 $silvester_stamp = strtotime ($silvester);
 
 
//construct an array of timestamps

 $special_date = array ("$neujahr_stamp", "$rosenmontag_stamp", "$karfreitag_stamp", "$ostermontag_stamp", "$tag_der_arbeit_stamp", "$christi_himmelfahrt_stamp", "$pfingstmontag_stamp", "$fronleichnam_stamp", "$tag_der_deutschen_einheit_stamp", "$allerheiligen_stamp", "$heiligabend_stamp", "$weihnachtstag_erster_stamp", "$weihnachtstag_zweiter_stamp", "$silvester_stamp");
 
 

//now check if the day selected in the calender belongs to the array of special dates and make it vaild (true) or non-valid (false), according to your needs

if(!isset($this->earliest_date))$this->EarliestArrival();

 if($datestamp>=$this->earliest_date){
   
	 if (in_array ("$datestamp", $special_date)) {
   $result['valid']=true;

   $result['class']='s_valid';    
   
	 //the following code has already been adapted to our needs (we deliver on weekends), it will probably look different in most of the cases, but does not affect the holiday-fix

}elseif(date('w',$datestamp)==6){

   $result['valid']=true;

   $result['class']='s_valid';

	 }elseif(date('w',$datestamp)==0){

   $result['valid']=true;	

   $result['class']='valid';
	 
     
	 }else{

   $result['valid']=false;

   $result['class']='invalid';

	 }

 }

 return $result;

}

 

 

Well, it's a little exhausting to fill in all your holidays manually, but that should do it for a quick fix. Let me know, if it works for you.

 

Boule

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...