Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shipdate contribution (shipping arrival date)


Guest

Recommended Posts

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

Just what I was looking for. Thank you.

 

Where is the calendar.css file that is mentioned to customize the calendar? Or better yet, does someone know how to modify checkout_shipping.php to use spiffycal instead of the current calendar?

Link to comment
Share on other sites

Just wondering why is the order date mandatory - not everyone will need to specify - supposed it is a store that offers local and shipping delivery - local is easy to choose arrival date - shipping by other carriers can be a real tossup.

Link to comment
Share on other sites

Whoops! I left that file out of the archive. I will upload a new version shortly.

 

I don't know about spiffycal. Is this something build into OSC? If so, I'd be very interested to find out. Please let me know!

 

thanks,

Matt Plummer

Link to comment
Share on other sites

In the admin panel when you add a new product or edit an existing product it asks for the date available The calendar that comes up, that is spiffycalendar. Someone already has a mod to use it with advanced search, so I am sure that it is possible.

Link to comment
Share on other sites

I'm probably not going to use it anytime soon -- I've read other posts that say it isn't compatible with all browsers.

 

I avoided Javascript for that reason, as well suppressed popups. PHP those issues, although the speed isn't so great.

 

Matt

Link to comment
Share on other sites

Hi Matt,

 

thank you for this great contribution. I was looking for that for ages. Is there any possibility to adapt it to function with a version prior to MS1? I am currently using a snapshot from around november 2002 and I don't have the time to update/rebuild my shop. As the shop is heavily customized, could you at least post a readme file containing only the changes you made to the original files instead of posting the new ones?

 

Thanx, I'd appreciate any help.

Link to comment
Share on other sites

I finally got this contribution working - it's working perfectly. Just one question remaining. We only deliver on weekends, that's why I adapted the shipsched.php to only make Saturdays and Sundays valid for selection of the delivery date. My problem is: does anyone have an idea how to switch specific dates (e.g. holiday) to "valid"/ how to integrate them?

Link to comment
Share on other sites

HI Patrick,

 

I have created an account called test... I have seen the calender, I have clicked to book a day and that is fine... (don't you need the time of the day)? ie... delivery between 12.00 - 16.00?

 

I Personally wouldn't like to be waiting at home all day for a delivery..

 

then, I click "Weiter" for next page, I would "re-show" the delivery date on the top of address..

ie..

 

delivery on: 25 Aug 2003

To:

Address

 

And I would show it until the last click..

 

I like the red note once you click on the delete box.. how do you do that?

 

Overall, the site looks nice. I understood how to go around even if I don't speak the language.

Link to comment
Share on other sites

Thanks for your positive feedback. In fact, as we deliver bakery products on a very local basis delivery time is always in a range between 06.00 - 09.00 a.m. The text above the comment field in checkout_success tells the customer to enter a time his products have to be delivered to his doorstep - if desired. If not, the orders are being delivered till 09.00 a.m. at the latest.

Until Matt realized this wonderful contribution delivery date also had to be entered via the comment field - which sometimes caused problems as delivery date is mandatory and we only deliver on weekends. Maybe it would be better to add time of delivery to checkout_shipping - as it is now with the delivery date (shipdate), I haven't succeeded in adding such a field yet. Anybody a hint?

The red text reminding the customer to update his cart comes from this contribution (which makes the use of javascript though): http://www.oscommerce.com/community/contributions,1008, if it's that waht you meant.

Link to comment
Share on other sites

Boule,

It's great that the contribution is working for you. The shop looks great!

 

I plan to include the idea of including/excluding specific holidays, etc. in the next release. For now, I might be able to give you some idea of how to modify the current release.

 

You will notice a function in the shipsched.php called DateInfo.

 

 

	function DateInfo($datestamp){

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

 if($datestamp>=$this->earliest_date){

	 if(date('w',$datestamp)==6){

   $result['valid']=true;

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

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

   $result['valid']=false;	

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

	 }else{

   $result['valid']=true;

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

	 }

 }else{

	 $result['valid']=false;

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

 }

 return $result;

}

 

I would add code that checks for the special dates 1st in the program... if it doesn't match the current date to the special one, then it would execute the code that is already there.

 

You could declare the special dates in the constructor function for the class in an array and then use 'in_array' to check whether the date being compared is in the array. Make sense?

 

Hopefully, this is helpful. Another thing I should do is automate these configuration things in the OSC adminstration end.

 

Matt Plummer

Link to comment
Share on other sites

  • 2 weeks later...

I install this great contribution, but the problem is that i can?t see the orders in ADMIN>Customers>Orders, i have a blank page with the title "Orders" and no table show.

In the catalog i can make the order and select the shipping date.

I?m using MS2.

 

Thanks.

Link to comment
Share on other sites

Dear friends:

This is a great job that you have done with the shipdate module. This is what I was looking for, I also translate this module to spanish and change it for the MS2.

 

Hey, it?s possible to post your contribution here?.

I need it for MS2 and in spanish too.

 

Thanks.

Link to comment
Share on other sites

  • 2 weeks later...

Hi Matt,

 

thanks for the advice concerning my problem to include special days (e.g. holidays) in the shipshed.php. Unfortunately I don't know enough about PHP to add the code. Could you please be a little more specific in your instructions? Or has anybody succeeded in adding this feature yet?

 

Boule

Link to comment
Share on other sites

I installed the update shipdate which works for MS2 and has Spanish too. Everything is fine except that when you view the order on the admin section you cannot see the shipdate. Looking at the PHP I see where it checks to see if the shipdate variable has the info from the database but I don't see where it actually gets it from Mysql. Has anyone else seen this problem?

Link to comment
Share on other sites

I am using the shipdate contrib and I think it is great, I have it working in my development store, I am not much of a scripter, anything beyond basic gets me lost....I have some problems...need to get live this week....

 

The big issue for me is that the shipdate module does an excellent job for most people and is extremely flexible, however I really need to be able to control things down to 30minute intervals (i.e shipdate roll-over at 10:30am) and this is not possible using the current scripts....The extra 30mins will make a big difference to the business model for the service we are offering (lunch delivery service)

 

I have looked at it and I believe the reason is the integer it uses to calculate the ship time and roll-over, this integer obviously can not handle the 30minute interval, or can it ?

 

I really need this urgently can anyone help, is it a simple change and my ignorance is making it look big ???

 

Thanks in advance....

Link to comment
Share on other sites

I am also having the problem of not being able to see the shipdate in the admin/orders section, has anybody fixed this..

 

I did try a few things but I just recieved the date of thursday, january 1 1970 for all shipdates on all orders....

 

I guess it is no good if you cant retrieve them ....and I so need it ???

 

any ideas ???

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

Link to comment
Share on other sites

Johnc,

 

The big issue for me is that the shipdate module does an excellent job for most people and is extremely flexible, however I really need to be able to control things down to 30minute intervals (i.e shipdate roll-over at 10:30am) and this is not possible using the current scripts....The extra 30mins will make a big difference to the business model for the service we are offering (lunch delivery service)

 

I have looked at it and I believe the reason is the integer it uses to calculate the ship time and roll-over, this integer obviously can not handle the 30minute interval, or can it ?

 

I really need this urgently can anyone help, is it a simple change and my ignorance is making it look big ???

 

Thanks in advance....

 

I have a modification that *should* solve your problem. Under the shipsched.php file, look for the EarliestArrival () function. Replace second line of that function, beginning with '$current_time', with

$current_time=date('G') + (date('i')/60);

 

After that, if you specify hours in ShippingSchedule() you should be able to specify 18.5 for 6:30pm, etc. and it will calculate correctly.

 

Let me know if it works for you,

Matt

 

p.s. thanks again for everyone who is continuing to contribute to this contribution!

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