This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function bkap_show_hide_persons_based_on_date( $data ) { | |
| $persons_to_hide = array( | |
| '84217' => array( // 84217 is product id | |
| array( | |
| 'dates' => '2023-06-25,2023-06-22', // in Y-m-d format. | |
| 'person_ids' => array( 84226, 84227 ), // 84226, 84227 are persons ids to hide | |
| ), | |
| array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Plugin Name: Vue Settings Page Plugin | |
| * Description: A WordPress plugin that adds a settings page with two tabs using Vue.js. | |
| * Version: 1.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'wcs_renewal_order_created', 'test_change_renewal_order_price', 10, 2 ); | |
| function test_change_renewal_order_price( $renewal_order, $subscription ) { | |
| // Get the line item for the subscription product | |
| $line_items = $renewal_order->get_items(); | |
| foreach( $line_items as $line_item ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| [ | |
| { | |
| "date": "2022-12-27", | |
| "start_time": "10:00", | |
| "end_time": "12:00", | |
| "availability": 10 | |
| } | |
| { | |
| "date": "2022-12-27", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "id": 4586, | |
| "name": "Date and time", | |
| "slug": "date-and-time-4", | |
| "permalink": "https://team-sandbox.tychesoftwares.com/kartik/product/date-and-time-4/", | |
| "date_created": "2022-12-19T16:29:06", | |
| "date_created_gmt": "2022-12-19T10:59:06", | |
| "date_modified": "2022-12-19T16:29:07", | |
| "date_modified_gmt": "2022-12-19T10:59:07", | |
| "type": "simple", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function custom_change_cart_meta( $cart ) { | |
| if ( is_admin() && ! defined( 'DOING_AJAX' ) ) | |
| return; | |
| if ( did_action( 'woocommerce_before_calculate_totals' ) >= 2 ) | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Setting booking fields data from the URL parameters. start and end date is passed in the URL parameters. This can be changed according to business requirements. e.g check_in and check_out. | |
| */ | |
| function bkap_set_bookings_via_get() { | |
| if ( isset( $_GET['start'] ) && isset( $_GET['end'] ) ) { | |
| $start_date = $_GET['start']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function bkap_booking_status_on_create_order( $status ) { | |
| if ( is_admin() ) { | |
| if ( isset( $_POST['original_post_status'] ) ) { | |
| return $status; | |
| } | |
| $status = 'pending-confirmation'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Global Time Slots Booking for the Durations Based Time. | |
| */ | |
| function bkap_additional_bookings_to_be_considered( $booking_idss, $product_id, $resource_id ) { | |
| // Getting Product ids that has Duration Based Time Booking Type. | |
| $args = array( | |
| 'post_type' => 'product', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| array( | |
| 'post_type' => 'bkap_booking', | |
| 'post_status' => array( 'paid', 'pending-confirmation', 'confirmed' ), | |
| 'posts_per_page' => -1, | |
| 'meta_query' => array( | |
| array( | |
| 'key' => '_bkap_start', | |
| 'value' => date( 'YmdHis', strtotime( 'today' ) ), |