Limit Calendar Dates

  • Posts: 88
  • Thank you received: 0
13 years 2 months ago #25727

Hi,

In the Business version you can feature a delivery calendar - is it possible to make some days unavailable; Saturdays, Sundays and Mondays for example? And also have the earliest date available three days from order?

Thanks

Darren

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 2 months ago #25735

That's not possible. We use the calendar library of joomla for that and it doesn't support that without a lot of coding and modifications. That's however an interesting request so we'll see if we can come up with a solution in the future, but for now, you won't be able to do it.

Please Log in or Create an account to join the conversation.

  • Posts: 88
  • Thank you received: 0
13 years 2 months ago #25740

Thanks Nicolas,

Our client has some specific delivery details they require, for example:

Order on Monday > Receive on Thursday
Order on Tuesday > Receive on Friday
Order on Wednesday > Receive on Tuesday
Order on Thursday > Receive on Wednesday
Order on Friday > Receive on Thursday
Order on Saturday > Receive on Thursday
Order on Sunday > Receive on Thursday

Is there a way of identifying the day the order is made and show the delivery date within the checkout and the email the customer receives, for example:

The customer orders a pie on Monday, when they check-out they see the text 'Expected Delivery Date: Thursday' which also appears on the email to the customer.

Sorry for the specifics - the client has changed their mind on this many time.

Darren

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 2 months ago #25741

That's possible.

For the checkout, you need to edit the file "cart" of the view "checkout" via the menu Display->Views. There you will have to add some PHP code, like that:

switch(date('N')){
case '1':
//Monday
case '5':
//Friday
case '6':
//Saturday
case '7':
//Sunday
echo 'Expected Delivery Date: Thursday';
break;
case '2':
//Tuesday
echo 'Expected Delivery Date: Friday';
break;
case '3':
//Wednesday
echo 'Expected Delivery Date: Tuesday';
break;
case '4':
//Thursday
echo 'Expected Delivery Date: Wednesday';
break;

}

For the email notification, you should edit it via the menu "System->Emails" (Business edition only) and add something similar but change the first line by:
switch(date('N',$data->order_modified)){

Please Log in or Create an account to join the conversation.

  • Posts: 88
  • Thank you received: 0
13 years 2 months ago #25745

Thanks Nicolas,

You guys are brilliant!

Darren

Please Log in or Create an account to join the conversation.

  • Posts: 88
  • Thank you received: 0
13 years 2 months ago #25814

Hi Nicolas,

This works like a charm - one thing though, is it possible to add the actual date as well as the day?

Thanks

Darren

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 2 months ago #25816

To display the date, you can do like that:

$day = 60*60*24;
switch(date('N')){
case '1':
//Monday
$date = time() + $day*3;
break;
case '5':
//Friday
$date = time() + $day*6;
break;
case '6':
//Saturday
$date = time() + $day*5;
break;
case '7':
//Sunday
$date = time() + $day*4;
break;
case '2':
//Tuesday
$date = time() + $day*3;
break;
case '3':
//Wednesday
$date = time() + $day*6;
break;
case '4':
//Thursday
$date = time() + $day*6;
break;

}
echo date('F j, Y',$date);

for the email notification, you would have to replace also time() by $data->order_modified
The format can be changed following this:
www.php.net/manual/en/function.date.php

Please Log in or Create an account to join the conversation.

  • Posts: 88
  • Thank you received: 0
13 years 2 months ago #25817

Thanks Nicolas - works perfectly!

Darren

Please Log in or Create an account to join the conversation.

Time to create page: 0.055 seconds
Powered by Kunena Forum