_booking_form_params.php
9 months ago
_booking_form_summary_panel.php
9 months ago
_booking_summary.php
1 year ago
_cart_clear.php
1 year ago
_cart_summary.php
9 months ago
_contact_form.php
2 months ago
_limit_reached.php
1 year ago
_monthly_calendar_days.php
1 year ago
_order_summary.php
1 year ago
_order_summary.php
96 lines
| 1 | <?php |
| 2 | /* |
| 3 | * Copyright (c) 2024 LatePoint LLC. All rights reserved. |
| 4 | */ |
| 5 | |
| 6 | /* @var $order OsOrderModel */ |
| 7 | |
| 8 | |
| 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | exit; // Exit if accessed directly |
| 11 | } |
| 12 | ?> |
| 13 | <div class="order-summary-main-section <?php echo (count($order->get_items()) > 1) ? 'multi-item' : 'single-item'; ?>"> |
| 14 | <?php |
| 15 | $order_bookings = $order->get_bookings_from_order_items(); |
| 16 | $order_bundles = $order->get_bundles_from_order_items(); |
| 17 | |
| 18 | ?> |
| 19 | |
| 20 | <div class="order-summary-items-heading"> |
| 21 | <?php esc_html_e( 'Order Items', 'latepoint' ); ?> |
| 22 | <div class="osih-line"></div> |
| 23 | </div> |
| 24 | <?php |
| 25 | |
| 26 | if ($order_bundles) { |
| 27 | foreach ($order_bundles as $order_item_id => $bundle) { |
| 28 | echo '<div class="summary-box-wrapper">'; |
| 29 | echo '<div class="order-item-bundle-info-wrapper">'; |
| 30 | echo '<div class="bundle-icon"><i class="latepoint-icon latepoint-icon-layers"></i></div>'; |
| 31 | echo OsBundlesHelper::generate_summary_for_bundle($bundle); |
| 32 | echo '</div>'; |
| 33 | echo '<div class="schedule-bundle-booking-btn-wrapper">'; |
| 34 | echo '<div class="schedule-bundle-booking-btn" '.OsCustomerHelper::generate_bundle_scheduling_btn($order_item_id).'><span>'.esc_html__('Start Scheduling', 'latepoint').'</span><i class="latepoint-icon latepoint-icon-arrow-2-right"></i></div>'; |
| 35 | echo '</div>'; |
| 36 | echo '</div>'; |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | if ($order_bookings) { |
| 41 | |
| 42 | $same_location = OsBookingHelper::bookings_have_same_location($order_bookings); |
| 43 | $same_agent = OsBookingHelper::bookings_have_same_agent($order_bookings); |
| 44 | |
| 45 | foreach ($order_bookings as $order_item_id => $order_booking) { |
| 46 | // key passed for order, means we need to get a key for a booking |
| 47 | if(!empty($key)){ |
| 48 | $booking_key = (($viewer ?? 'customer') == 'customer') ? OsMetaHelper::get_booking_meta_by_key( 'key_to_manage_for_customer', $order_booking->id ) : OsMetaHelper::get_booking_meta_by_key( 'key_to_manage_for_agent', $order_booking->id ); |
| 49 | } |
| 50 | echo '<div class="summary-box-wrapper">'; |
| 51 | echo OsBookingHelper::generate_summary_for_booking($order_booking, false, $viewer ?? 'customer'); |
| 52 | OsBookingHelper::generate_summary_actions_for_booking($order_booking, $booking_key ?? null); |
| 53 | if (!$same_agent || !$same_location) { |
| 54 | echo '<div class="booking-summary-info-w">'; |
| 55 | echo '<div class="summary-boxes-columns">'; |
| 56 | if (!$same_agent && (OsAgentHelper::count_agents() > 1)) OsAgentHelper::generate_summary_for_agent($order_booking); |
| 57 | if (!$same_location) OsLocationHelper::generate_summary_for_location($order_booking); |
| 58 | echo '</div>'; |
| 59 | echo '</div>'; |
| 60 | } |
| 61 | echo '</div>'; |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | |
| 66 | if ($order_bookings) { |
| 67 | echo '<div class="booking-summary-info-w">'; |
| 68 | echo '<div class="summary-boxes-columns">'; |
| 69 | if ($same_agent && (OsAgentHelper::count_agents() > 1)) OsAgentHelper::generate_summary_for_agent(reset($order_bookings)); |
| 70 | if ($same_location) OsLocationHelper::generate_summary_for_location(reset($order_bookings)); |
| 71 | OsCustomerHelper::generate_summary_for_customer($order->customer); |
| 72 | echo '</div>'; |
| 73 | echo '</div>'; |
| 74 | }else{ |
| 75 | echo '<div class="booking-summary-info-w">'; |
| 76 | echo '<div class="summary-boxes-columns">'; |
| 77 | OsCustomerHelper::generate_summary_for_customer($order->customer); |
| 78 | echo '</div>'; |
| 79 | echo '</div>'; |
| 80 | } |
| 81 | |
| 82 | do_action('latepoint_order_summary_before_price_breakdown', $order); |
| 83 | ?> |
| 84 | </div> |
| 85 | <?php if( $order->get_subtotal() > 0 || OsSettingsHelper::is_off('hide_breakdown_if_subtotal_zero')){ ?> |
| 86 | <div class="summary-price-breakdown-wrapper"> |
| 87 | <div class="pb-heading"> |
| 88 | <div class="pbh-label"><?php esc_html_e('Cost Breakdown', 'latepoint'); ?></div> |
| 89 | <div class="pbh-line"></div> |
| 90 | </div> |
| 91 | <?php |
| 92 | $price_breakdown_rows = $order->generate_price_breakdown_rows(); |
| 93 | OsPriceBreakdownHelper::output_price_breakdown($price_breakdown_rows); |
| 94 | ?> |
| 95 | </div> |
| 96 | <?php } ?> |