Disable Pay Now Button Until Booking Date Occurs

Is there a PHP snippet to disable (but not hide) the “Pay Now” button until any date greater than or equal to the date of the booking?

Unfortunately, there is no simple snippet, it requires advanced customization by overriding the /plugins/hivepress-bookings/templates/booking/view/page/booking-pay-link.php and /plugins/hivepress-bookings/templates/booking/view/block/booking-pay-link.php template part via a child theme. There is a tutorial on how to customize templates Customizing Templates I HivePress Developer Docs - YouTube

If you are not familiar with the code customization then please consider hiring someone for custom work https://fvrr.co/32e7LvY

We already have a child theme for HivePress. Please provide the the custom PHP to override this in the /plugins/hivepress-bookings/templates/booking/view/page/booking-pay-link.php and we will take care of the customization.

We can override any of the HivePress functionality in our child theme and that is how we’ve been modifying out solution all along.

Please try to add this condition to add this restriction for the button. Please note that if the expiration date setting is set in HivePress/Settings/Bookings then the unpaid bookings will be deleted automatically after the number of days that are set in this setting. If you are not familiar with code customization then please consider hiring someone for custom work https://fvrr.co/32e7LvY

if ( strtotime( 'today' ) >= $booking->get_start_time() ) {
    //do something
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.