PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.15
Timetics – Appointment Booking Calendar & Scheduling v1.0.15
1.0.62 1.0.63 1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 All 64 releases
timetics / templates / woocommerce / coupon-restriction-option.php

coupon-restriction-option.php in Timetics – Appointment Booking Calendar & Scheduling 1.0.15, at templates/woocommerce/coupon-restriction-option.php

38 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WooCommerce Coupon Restriction Option Template
4 *
5 * @package Timetics
6 */
7
8 $selected_ids = get_post_meta( $coupon_id, 'timetics_meeting_ids', true );
9 $selected_ids = ! empty( $selected_ids ) ? $selected_ids : [];
10
11 ?>
12 <p class="form-field">
13 <label><?php _e( 'Timetics Meetings', 'timetics' ); ?></label>
14 <select class="timetics-product-search" multiple="multiple" style="width: 50%;" name="timetics_meeting_ids[]" data-placeholder="<?php esc_attr_e( 'Search for a product&hellip;', 'timetics' ); ?>">
15 <?php
16 $args = array(
17 'status' => 'publish',
18 'limit' => -1,
19 'category' => array( 'timetics-meeting' ),
20 );
21 $products = wc_get_products( $args );
22
23 foreach ( $products as $product ) {
24 $selected = in_array( $product->get_id(), $selected_ids );
25 if ( is_object( $product ) ) {
26 echo '<option value="' . esc_attr( $product->get_id() ) . '"' . selected( $selected, true, false ) . '>' . esc_html( wp_strip_all_tags( $product->get_formatted_name() ) ) . '</option>';
27 }
28 }
29 ?>
30 </select>
31 <?php echo wc_help_tip( __( 'Products that the coupon will be applied to, or that need to be in the cart in order for the "Fixed cart discount" to be applied.', 'timetics' ) ); ?>
32 </p>
33 <script>
34 jQuery(function($) {
35 $('.timetics-product-search').select2();
36 });
37 </script>
38