PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.63
Timetics – Appointment Booking Calendar & Scheduling v1.0.63
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.63, at templates/woocommerce/coupon-restriction-option.php

43 lines 1.7 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 defined( 'ABSPATH' ) || exit;
9
10 $timetics_selected_ids = get_post_meta( $coupon_id, 'timetics_meeting_ids', true );
11 $timetics_selected_ids = ! empty( $timetics_selected_ids ) ? $timetics_selected_ids : [];
12
13 // Add nonce field for security
14 wp_nonce_field( 'timetics_coupon_action', 'timetics_coupon_nonce' );
15
16 ?>
17 <p class="form-field">
18 <label><?php esc_html_e( 'Timetics Meetings', 'timetics' ); ?></label>
19 <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' ); ?>">
20 <?php
21 $timetics_args = array(
22 'status' => 'publish',
23 'limit' => -1,
24 'category' => array( 'timetics-meeting' ),
25 );
26 $timetics_products = wc_get_products( $timetics_args );
27
28 foreach ( $timetics_products as $timetics_product ) {
29 $timetics_selected = in_array( $timetics_product->get_id(), $timetics_selected_ids );
30 if ( is_object( $timetics_product ) ) {
31 echo '<option value="' . esc_attr( $timetics_product->get_id() ) . '"' . selected( $timetics_selected, true, false ) . '>' . esc_html( wp_strip_all_tags( $timetics_product->get_formatted_name() ) ) . '</option>';
32 }
33 }
34 ?>
35 </select>
36 <?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' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
37 </p>
38 <script>
39 jQuery(function($) {
40 $('.timetics-product-search').select2();
41 });
42 </script>
43