<?php
namespace JET_ABAF;
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
class Seasonal_Price {
/**
* Post meta
*/
private $post_meta;
public function __construct( $post_meta = [] ) {
$this->post_meta = $post_meta;
}
/**
* Retrieves the seasonal prices configured for the current context.
*
* @since 2.2.5
* @since 4.1.0 Added `jet-booking/price/seasonal-prices` hook.
*
* @return array An array of seasonal pricing data.
*/
public function get_price() {
$output = [];
if ( empty( $this->post_meta['_seasonal_prices'] ) ) {
return $output;
}
foreach ( $this->post_meta['_seasonal_prices'] as $value ) {
$rates_price = new Advanced_Price_Rates( $this->post_meta['ID'] ?? 0, $value );
$weekend_price = new Weekend_Price( $value );
$output_value = [
'start' => $value['startTimestamp'],
'end' => $value['endTimestamp'],
'price' => $value['price'],
'price_rates' => $rates_price->get_rates(),
'weekend_price' => $weekend_price->get_price(),
];
if ( isset( $value['enable_config'] ) && $value['enable_config'] ) {
$output_value += [
'enable_config' => $value['enable_config'],
'start_day_offset' => $value['start_day_offset'] ?? 0,
'min_days' => $value['min_days'] ?? 0,
'max_days' => $value['max_days'] ?? 0,
];
}
$output[ $value['startTimestamp'] . $value['endTimestamp'] ] = $output_value;
}
return apply_filters( 'jet-booking/price/seasonal-prices', $output, $this->post_meta, $this );
}
}
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| actions/ | 2026-07-21 14:16 | 3.54 KB | 76129f60960:kunden | dxwrx-r--r | |
| compatibility/ | 2026-07-21 14:16 | 102.94 KB | 76129f60960:kunden | dxwrx-r--r | |
| components/ | 2026-07-21 14:16 | 315.47 KB | 76129f60960:kunden | dxwrx-r--r | |
| cron/ | 2026-07-21 14:16 | 15.24 KB | 76129f60960:kunden | dxwrx-r--r | |
| dashboard/ | 2026-07-21 14:16 | 68.07 KB | 76129f60960:kunden | dxwrx-r--r | |
| db/ | 2026-07-21 14:16 | 44.01 KB | 76129f60960:kunden | dxwrx-r--r | |
| form-fields/ | 2026-07-21 14:16 | 4.28 KB | 76129f60960:kunden | dxwrx-r--r | |
| formbuilder-plugin/ | 2026-07-21 14:16 | 44.48 KB | 76129f60960:kunden | dxwrx-r--r | |
| framework/ | 2026-07-21 14:16 | 1.49 MB | 76129f60960:kunden | dxwrx-r--r | |
| macros/ | 2026-07-21 14:16 | 34.15 KB | 76129f60960:kunden | dxwrx-r--r | |
| multivendors/ | 2026-07-21 14:16 | 27 KB | 76129f60960:kunden | dxwrx-r--r | |
| render/ | 2026-07-21 14:16 | 16.17 KB | 76129f60960:kunden | dxwrx-r--r | |
| resources/ | 2026-07-21 14:16 | 28.38 KB | 76129f60960:kunden | dxwrx-r--r | |
| rest-api/ | 2026-07-21 14:16 | 35.46 KB | 76129f60960:kunden | dxwrx-r--r | |
| stores/ | 2026-07-21 14:16 | 4.32 KB | 76129f60960:kunden | dxwrx-r--r | |
| vendor/ | 2026-07-21 14:16 | 77.89 KB | 76129f60960:kunden | dxwrx-r--r | |
| visibility-conditions/ | 2026-07-21 14:16 | 3.69 KB | 76129f60960:kunden | dxwrx-r--r | |
| wc-integration/ | 2026-07-21 14:16 | 164.96 KB | 76129f60960:kunden | dxwrx-r--r | |
| workflows/ | 2026-07-21 14:16 | 34.38 KB | 76129f60960:kunden | dxwrx-r--r | |
| advanced-price-rates.php | 2026-07-21 14:16 | 1.5 KB | 76129f60960:kunden | -xw-x----- | |
| ajax-handlers.php | 2026-07-21 14:16 | 12.02 KB | 76129f60960:kunden | -xw-x----- | |
| apartment-booking-trait.php | 2026-07-21 14:16 | 8.27 KB | 76129f60960:kunden | -xw-x----- | |
| assets.php | 2026-07-21 14:16 | 6.3 KB | 76129f60960:kunden | -xw-x----- | |
| autoloader.php | 2026-07-21 14:16 | 1.49 KB | 76129f60960:kunden | -xw-x----- | |
| booking-functions.php | 2026-07-21 14:16 | 1.65 KB | 76129f60960:kunden | -xw-x----- | |
| capabilities.php | 2026-07-21 14:16 | 491 B | 76129f60960:kunden | -xw-x----- | |
| export.php | 2026-07-21 14:16 | 8.22 KB | 76129f60960:kunden | -xw-x----- | |
| google-calendar.php | 2026-07-21 14:16 | 5.88 KB | 76129f60960:kunden | -xw-x----- | |
| ical.php | 2026-07-21 14:16 | 19.35 KB | 76129f60960:kunden | -xw-x----- | |
| plugin.php | 2026-07-21 14:16 | 7.35 KB | 76129f60960:kunden | -xw-x----- | |
| price.php | 2026-07-21 14:16 | 13.4 KB | 76129f60960:kunden | -xw-x----- | |
| seasonal-price.php | 2026-07-21 14:16 | 1.54 KB | 76129f60960:kunden | -xw-x----- | |
| set-up.php | 2026-07-21 14:16 | 7.21 KB | 76129f60960:kunden | -xw-x----- | |
| settings.php | 2026-07-21 14:16 | 32.28 KB | 76129f60960:kunden | -xw-x----- | |
| statuses.php | 2026-07-21 14:16 | 3.05 KB | 76129f60960:kunden | -xw-x----- | |
| tools.php | 2026-07-21 14:16 | 31.31 KB | 76129f60960:kunden | -xw-x----- | |
| upgrade.php | 2026-07-21 14:16 | 11.17 KB | 76129f60960:kunden | -xw-x----- | |
| weekend-price.php | 2026-07-21 14:16 | 1.17 KB | 76129f60960:kunden | -xw-x----- | |