diff --git a/assets/public/sass/partials/_single.scss b/assets/public/sass/partials/_single.scss index 00b9e7858..014962188 100644 --- a/assets/public/sass/partials/_single.scss +++ b/assets/public/sass/partials/_single.scss @@ -23,3 +23,28 @@ } } } + +/* Funding links rendered as buttons on the booking confirmation page */ +.cb-booking-funding { + .cb-button-funding-local, + .cb-button-funding-plugin { + @extend .cb-button; + display: inline-flex; + align-items: center; + gap: var(--commonsbooking-spacer-small); + } + + .cb-button-funding-local { + background-color: var(--commonsbooking-color-secondary); /* CB blue */ + } + + .cb-button-funding-plugin { + background-color: var(--commonsbooking-color-primary); /* CB light green */ + } + + .cb-funding-logo { + height: 1.2em; + width: auto; + vertical-align: middle; + } +} diff --git a/includes/OptionsArray.php b/includes/OptionsArray.php index 0601828bc..efe15d348 100644 --- a/includes/OptionsArray.php +++ b/includes/OptionsArray.php @@ -179,6 +179,88 @@ 'id' => 'globalLocationSettings', 'fields' => Location::getOverbookingSettingsMetaboxes(), ), + 'contactSupport' => array( + 'title' => __( 'Contact, support & legal', 'commonsbooking' ), + 'id' => 'contactSupport', + 'desc' => commonsbooking_sanitizeHTML( __( 'These details are shown on the booking confirmation page in the "Need help?", "Rate our service" and "Booking terms" sections. Leave any field empty to hide that line.', 'commonsbooking' ) ), + 'fields' => array( + array( + 'name' => esc_html__( 'Support phone number', 'commonsbooking' ), + 'desc' => esc_html__( 'Phone number rendered as a clickable tel: link in the "Need help?" section.', 'commonsbooking' ), + 'id' => 'contact_phone', + 'type' => 'text', + 'default' => '', + ), + array( + 'name' => esc_html__( 'Support email', 'commonsbooking' ), + 'desc' => esc_html__( 'Email address rendered as a mailto: link in the "Need help?" section.', 'commonsbooking' ), + 'id' => 'contact_email', + 'type' => 'text', + 'default' => '', + ), + array( + 'name' => esc_html__( 'Contact form URL', 'commonsbooking' ), + 'desc' => esc_html__( 'Full URL to a contact form page. Shown as a link in the "Need help?" section.', 'commonsbooking' ), + 'id' => 'contact_form_url', + 'type' => 'text_url', + 'default' => '', + ), + array( + 'name' => esc_html__( 'Service rating URL', 'commonsbooking' ), + 'desc' => esc_html__( 'External rating or review URL (e.g. a Google review link or feedback form). Shown in the "Rate our service" section.', 'commonsbooking' ), + 'id' => 'service_rating_url', + 'type' => 'text_url', + 'default' => '', + ), + array( + 'name' => esc_html__( 'Booking terms (AGB) URL', 'commonsbooking' ), + 'desc' => esc_html__( 'Link to your booking terms or AGB page. Shown as a "Booking terms" link.', 'commonsbooking' ), + 'id' => 'booking_terms_url', + 'type' => 'text_url', + 'default' => '', + ), + array( + 'name' => esc_html__( 'Show "Fund the local initiative" link', 'commonsbooking' ), + 'desc' => esc_html__( 'When enabled and a URL is set below, a link inviting users to support your local initiative is shown on the booking confirmation page.', 'commonsbooking' ), + 'id' => 'fund_local_enable', + 'type' => 'checkbox', + ), + array( + 'name' => esc_html__( 'Local initiative funding label', 'commonsbooking' ), + 'desc' => esc_html__( 'Link text shown for the local initiative funding link.', 'commonsbooking' ), + 'id' => 'fund_local_label', + 'type' => 'text', + 'default' => esc_html__( 'Support our initiative', 'commonsbooking' ), + ), + array( + 'name' => esc_html__( 'Local initiative funding URL', 'commonsbooking' ), + 'desc' => esc_html__( 'URL to your donation or membership page.', 'commonsbooking' ), + 'id' => 'fund_local_url', + 'type' => 'text_url', + 'default' => '', + ), + array( + 'name' => esc_html__( 'Show "Fund plugin development" link', 'commonsbooking' ), + 'desc' => esc_html__( 'When enabled, a link inviting users to support CommonsBooking plugin development is shown on the booking confirmation page.', 'commonsbooking' ), + 'id' => 'fund_plugin_enable', + 'type' => 'checkbox', + ), + array( + 'name' => esc_html__( 'Plugin funding label', 'commonsbooking' ), + 'desc' => esc_html__( 'Link text shown for the plugin development funding link.', 'commonsbooking' ), + 'id' => 'fund_plugin_label', + 'type' => 'text', + 'default' => esc_html__( 'Support CommonsBooking development', 'commonsbooking' ), + ), + array( + 'name' => esc_html__( 'Plugin funding URL', 'commonsbooking' ), + 'desc' => esc_html__( 'URL to the CommonsBooking project donation page. Defaults to the wielebenwir support page.', 'commonsbooking' ), + 'id' => 'fund_plugin_url', + 'type' => 'text_url', + 'default' => 'https://www.wielebenwir.de/verein/unterstutzen', + ), + ), + ), ), ), /* Tab: general end*/ diff --git a/templates/booking-single.php b/templates/booking-single.php index 612330063..9df912c50 100644 --- a/templates/booking-single.php +++ b/templates/booking-single.php @@ -24,6 +24,22 @@ $current_status = $booking->post_status; $internal_comment = $booking->getMeta( 'internal-comment' ); +$contact_phone = Settings::getOption( 'commonsbooking_options_general', 'contact_phone' ); +$contact_email = Settings::getOption( 'commonsbooking_options_general', 'contact_email' ); +$contact_form_url = Settings::getOption( 'commonsbooking_options_general', 'contact_form_url', 'esc_url' ); +$service_rating_url = Settings::getOption( 'commonsbooking_options_general', 'service_rating_url', 'esc_url' ); +$booking_terms_url = Settings::getOption( 'commonsbooking_options_general', 'booking_terms_url', 'esc_url' ); + +$fund_local_enable = Settings::getOption( 'commonsbooking_options_general', 'fund_local_enable' ); +$fund_local_label = Settings::getOption( 'commonsbooking_options_general', 'fund_local_label' ); +$fund_local_url = Settings::getOption( 'commonsbooking_options_general', 'fund_local_url', 'esc_url' ); +$fund_plugin_enable = Settings::getOption( 'commonsbooking_options_general', 'fund_plugin_enable' ); +$fund_plugin_label = Settings::getOption( 'commonsbooking_options_general', 'fund_plugin_label' ); +$fund_plugin_url = Settings::getOption( 'commonsbooking_options_general', 'fund_plugin_url', 'esc_url' ); + +$show_fund_local = ( $fund_local_enable === 'on' ) && ! empty( $fund_local_url ); +$show_fund_plugin = ( $fund_plugin_enable === 'on' ) && ! empty( $fund_plugin_url ); + do_action( 'commonsbooking_before_booking-single', $booking->ID, $booking ); @@ -187,6 +203,92 @@ +
+ + + + + + +