Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking Check In/Out Status
- This topic has 17 replies, 4 voices, and was last updated 5 months, 3 weeks ago by J. Davis.
- AuthorPosts
- April 23, 2024 at 6:03 am #1606114Michael SturgillParticipant
Is it possible to have a status like “Check In” or “Check Out” to use when a customer arrives and leaves?
May 6, 2024 at 1:19 pm #1612640J. DavisKeymasterHi Michael,
Thanks for your question. There is no such an option but I may create a request for this feature if you can describe how exactly it should work. I’d appreciate it if you could create screenshots/illustrations of this option, whether it is applied automatically or manually, and specify the section of the dashboard where it can be used and how it should look. Thanks.May 15, 2024 at 4:06 pm #1617452Michael SturgillParticipantFor our campground I think this could be accomplished with statuses labeled “Check-In” and “Check-Out” in the admin backend. It would not be seen by customers. Our goal is to be able to track when a customer actually arrives on site (“Check-In” status) and when they have left (“Check-Out” status). This would let us track who is actually in our campground as well as track no-shows so that those camper spots could be sold on busy weekends.
May 16, 2024 at 5:09 pm #1618212Abraham KParticipantI think there should be a Ready-to-check-in status (when payment is cleared) and a checked-in status (when the guest actually arrives) and then checked-out, i think this would be really helpful, and would solve many issues brought-up by users.
May 16, 2024 at 5:11 pm #1618213Michael SturgillParticipantYes, that’s exactly what I had in mind. You explained it better than I did lol.
May 16, 2024 at 5:16 pm #1618216Abraham KParticipantThis reply has been marked as private.May 23, 2024 at 5:54 am #1621969J. DavisKeymasterHi, do you mean you would like to add new statuses here https://prnt.sc/uYYNUlt6IpW4 and they should be changed automatically depending on the payment check-in and check-out dates?
May 23, 2024 at 6:01 am #1621977Michael SturgillParticipantYes, but the status would not be an automatic update based on the payment. We would like to use it manually only, for example:
Customer A arrives at the campground and checks in at our front desk. We would change the status for Customer A’s reservation to “Checked In” so that we know they are in the park. When Customer A checks out at our front desk to leave, we would change the reservation status to “Checked Out” so that we know Customer A has left and that spot is available if we need to assign it to someone else.
Another scenario would be Customer B has a reservation but chose to pay when they arrive. It is past the check-in time and Customer B has not arrived. Customer C arrives and does not have a reservation but would like to purchase an RV spot. Since we know Customer B does not have a “Checked In” status, we can assign that spot to Customer C.
May 23, 2024 at 6:29 am #1621996Rory DeckParticipantI’ve also been trying to implement a Checked in status. I can do it by updating the plugin code directly but I don’t want to do that since I will constantly have to redo it on plugin updates so I’ve tried to build a secondary plugin that hooks into your classes but have not had any success so far. The idea is basically just to change the “confirmed” status to “checked in”, and then have the color on the booking calendar change. This way the users can visually see that their customers have checked in/out on the calendar view. I wont pretend to know why that is important, but I have been asked for this feature by every client I’ve used this plugin for so I started looking into building something myself. Would be great if you could implement it though, I was able to do it with your code in about 20 minutes while blindly looking through code files so it should be a very quick implementation on your end.
May 23, 2024 at 6:59 am #1622029Rory DeckParticipantJust for reference,
<?php
namespace MPHB\PostTypes\BookingCPT;
use \MPHB\PostTypes\AbstractCPT;
class Statuses extends AbstractCPT\Statuses {
const STATUS_CONFIRMED = ‘confirmed’;
const STATUS_PENDING = ‘pending’;
const STATUS_PENDING_USER = ‘pending-user’;
const STATUS_PENDING_PAYMENT = ‘pending-payment’;
const STATUS_CANCELLED = ‘cancelled’;
const STATUS_ABANDONED = ‘abandoned’;
const STATUS_AUTO_DRAFT = ‘auto-draft’;
const STATUS_CHECKED_IN = ‘checked-in’; // New statuspublic function __construct( $postType ) {
parent::__construct( $postType );
add_action( ‘transition_post_status’, array( $this, ‘transitionStatus’ ), 10, 3 );
}protected function initStatuses() {
$this->statuses[ self::STATUS_PENDING_USER ] = array(
‘lock_room’ => true,
);$this->statuses[ self::STATUS_PENDING_PAYMENT ] = array(
‘lock_room’ => true,
);$this->statuses[ self::STATUS_PENDING ] = array(
‘lock_room’ => true,
);$this->statuses[ self::STATUS_ABANDONED ] = array(
‘lock_room’ => false,
);$this->statuses[ self::STATUS_CONFIRMED ] = array(
‘lock_room’ => true,
);$this->statuses[ self::STATUS_CANCELLED ] = array(
‘lock_room’ => false,
);$this->statuses[ self::STATUS_CHECKED_IN ] = array( // New status
‘lock_room’ => true,
);
}public function getStatusArgs( $statusName ) {
$args = array();switch ( $statusName ) {
case self::STATUS_PENDING_USER:
$args = array(
‘label’ => _x( ‘Pending User Confirmation’, ‘Booking status’, ‘motopress-hotel-booking’ ),
‘public’ => true,
‘exclude_from_search’ => false,
‘show_in_admin_all_list’ => true,
‘show_in_admin_status_list’ => true,
‘label_count’ => _n_noop( ‘Pending User Confirmation <span class=”count”>(%s)</span>’, ‘Pending User Confirmation <span class=”count”>(%s)</span>’, ‘motopress-hotel-booking’ ),
);
break;case self::STATUS_PENDING_PAYMENT:
$args = array(
‘label’ => _x( ‘Pending Payment’, ‘Booking status’, ‘motopress-hotel-booking’ ),
‘public’ => true,
‘exclude_from_search’ => false,
‘show_in_admin_all_list’ => true,
‘show_in_admin_status_list’ => true,
‘label_count’ => _n_noop( ‘Pending Payment <span class=”count”>(%s)</span>’, ‘Pending Payment <span class=”count”>(%s)</span>’, ‘motopress-hotel-booking’ ),
);
break;case self::STATUS_PENDING:
$args = array(
‘label’ => _x( ‘Pending Admin’, ‘Booking status’, ‘motopress-hotel-booking’ ),
‘public’ => true,
‘exclude_from_search’ => false,
‘show_in_admin_all_list’ => true,
‘show_in_admin_status_list’ => true,
‘label_count’ => _n_noop( ‘Pending Admin <span class=”count”>(%s)</span>’, ‘Pending Admin <span class=”count”>(%s)</span>’, ‘motopress-hotel-booking’ ),
);
break;case self::STATUS_ABANDONED:
$args = array(
‘label’ => _x( ‘Abandoned’, ‘Booking status’, ‘motopress-hotel-booking’ ),
‘public’ => true,
‘exclude_from_search’ => false,
‘show_in_admin_all_list’ => true,
‘show_in_admin_status_list’ => true,
‘label_count’ => _n_noop( ‘Abandoned <span class=”count”>(%s)</span>’, ‘Abandoned <span class=”count”>(%s)</span>’, ‘motopress-hotel-booking’ ),
);
break;case self::STATUS_CONFIRMED:
$args = array(
‘label’ => _x( ‘Confirmed’, ‘Booking status’, ‘motopress-hotel-booking’ ),
‘public’ => true,
‘exclude_from_search’ => false,
‘show_in_admin_all_list’ => true,
‘show_in_admin_status_list’ => true,
‘label_count’ => _n_noop( ‘Confirmed <span class=”count”>(%s)</span>’, ‘Confirmed <span class=”count”>(%s)</span>’, ‘motopress-hotel-booking’ ),
);
break;case self::STATUS_CANCELLED:
$args = array(
‘label’ => _x( ‘Cancelled’, ‘Booking status’, ‘motopress-hotel-booking’ ),
‘public’ => true,
‘exclude_from_search’ => false,
‘show_in_admin_all_list’ => true,
‘show_in_admin_status_list’ => true,
‘label_count’ => _n_noop( ‘Cancelled <span class=”count”>(%s)</span>’, ‘Cancelled <span class=”count”>(%s)</span>’, ‘motopress-hotel-booking’ ),
);
break;case self::STATUS_CHECKED_IN: // New status
$args = array(
‘label’ => _x( ‘Checked In’, ‘Booking status’, ‘motopress-hotel-booking’ ),
‘public’ => true,
‘exclude_from_search’ => false,
‘show_in_admin_all_list’ => true,
‘show_in_admin_status_list’ => true,
‘label_count’ => _n_noop( ‘Checked In <span class=”count”>(%s)</span>’, ‘Checked In <span class=”count”>(%s)</span>’, ‘motopress-hotel-booking’ ),
);
break;
}
return $args;
}public function transitionStatus( $newStatus, $oldStatus, $post ) {
if ( $post->post_type !== $this->postType ) {
return;
}if ( $newStatus === $oldStatus ) {
return;
}if ( apply_filters( ‘mphb_prevent_handle_booking_status_transition’, false ) ) {
return;
}$booking = MPHB()->getBookingRepository()->findById( $post->ID, true );
if ( $oldStatus == ‘new’ ) {
$booking->generateKey();
}if ( $newStatus === self::STATUS_PENDING_USER ) {
$booking->updateExpiration( ‘user’, time() + MPHB()->settings()->main()->getUserApprovalTime() * MINUTE_IN_SECONDS );
MPHB()->cronManager()->getCron( ‘abandon_booking_pending_user’ )->schedule();
}if ( $oldStatus === self::STATUS_PENDING_USER ) {
$booking->deleteExpiration( ‘user’ );
}if ( $newStatus === self::STATUS_PENDING_PAYMENT ) {
$booking->updateExpiration( ‘payment’, time() + MPHB()->settings()->payment()->getPendingTime() * MINUTE_IN_SECONDS );
MPHB()->cronManager()->getCron( ‘abandon_booking_pending_payment’ )->schedule();
}if ( $oldStatus === self::STATUS_PENDING_PAYMENT ) {
$booking->deleteExpiration( ‘payment’ );
}$booking->addLog( sprintf( __( ‘Status changed from %s to %s.’, ‘motopress-hotel-booking’ ), mphb_get_status_label( $oldStatus ), mphb_get_status_label( $newStatus ) ) );
do_action( ‘mphb_booking_status_changed’, $booking, $oldStatus );
$customerId = get_post_meta( $booking->getId(), ‘mphb_customer_id’, true );
if ( $customerId ) {
MPHB()->customers()->updateBookings( $customerId );
}if ( $newStatus === self::STATUS_CONFIRMED ) {
do_action( ‘mphb_booking_confirmed’, $booking, $oldStatus );
}if ( $newStatus === self::STATUS_CANCELLED ) {
do_action( ‘mphb_booking_cancelled’, $booking, $oldStatus );
}if ( $newStatus === self::STATUS_CHECKED_IN ) { // New status
do_action( ‘mphb_booking_checked_in’, $booking, $oldStatus );
}
}public function getLockedRoomStatuses() {
return array_keys(
array_filter(
$this->statuses,
function( $status ) {
return isset( $status[‘lock_room’] ) && $status[‘lock_room’];
}
)
);
}public function getBookedRoomStatuses() {
return array( self::STATUS_CONFIRMED, self::STATUS_CHECKED_IN ); // Include new status
}public function getPendingRoomStatuses() {
return array(
self::STATUS_PENDING,
self::STATUS_PENDING_USER,
self::STATUS_PENDING_PAYMENT,
);
}public function getFailedStatuses() {
return array(
self::STATUS_CANCELLED,
self::STATUS_ABANDONED,
);
}public function getAvailableRoomStatuses() {
return array_merge( ‘trash’, array_diff( array_keys( $this->statuses ), $this->getLockedRoomStatuses() ) );
}public function getDefaultNewBookingStatus() {
$confirmationMode = MPHB()->settings()->main()->getConfirmationMode();switch ( $confirmationMode ) {
case ‘manual’:
$defaultStatus = self::STATUS_PENDING;
break;
case ‘payment’:
$defaultStatus = self::STATUS_PENDING_PAYMENT;
break;
case ‘auto’:
default:
$defaultStatus = self::STATUS_PENDING_USER;
break;
}return $defaultStatus;
}
}Although I could not find where to change the color in the booking calendar code. But just something simple like that
May 23, 2024 at 5:32 pm #1622197Abraham KParticipantAs i wrote before having an option Ready-to-check-in, this should happen automatically when its fully paid (unless they choose to pay at the premises), and then another status checked-in, this should be done manually when the guest shows up and the same with checked-out
May 24, 2024 at 6:42 am #1622540J. DavisKeymasterThanks for your feedback. I will add this request to our list of features.
As for the ‘Ready For Check In’ or ‘Paid’ status – what if the owner charges the guest on arrival fully or partially (when the deposit payment is enabled). How can the plugin know when the booking is ready for check-in to assign this status? Thanks
May 24, 2024 at 6:47 am #1622542Rory DeckParticipantThis reply has been marked as private.May 26, 2024 at 1:12 pm #1623369Abraham KParticipantIm not using that option, but i believe the user should be able to set when the guests status should be Ready-to-check-in, like fully paid, partially paid, or even nothing paid.
May 27, 2024 at 6:28 am #1623666J. DavisKeymasterHi Rory,
You may add the new status to the legend in the following file:
\wp-content\plugins\motopress-hotel-booking\includes\bookings-calendar.php - AuthorPosts
- You must be logged in to reply to this topic.