public function search_courses()
 {
     $args = wp_parse_args($_POST['data'], array('post_type' => 'product', 'posts_per_page' => -1, 'post_status' => 'publish', 'meta_query' => array(array('key' => '_visibility', 'value' => 'hidden', 'compare' => '!='))));
     wp_send_json(array('response' => 'success', 'html' => wc_get_template_html('search-courses.php', array('products' => new WP_Query($args), 's' => $args['s'])), 'args' => $args));
 }
 /**
  * Get content plain.
  *
  * @access public
  * @return string
  */
 function get_content_plain()
 {
     return wc_get_template_html($this->template_plain, array('order' => $this->object, 'email_heading' => $this->get_heading(), 'customer_note' => $this->customer_note, 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this));
 }
 /**
  * Get content plain.
  *
  * @access public
  * @return string
  */
 public function get_content_plain()
 {
     return wc_get_template_html($this->template_plain, array('email_heading' => $this->get_heading(), 'user_login' => $this->user_login, 'user_pass' => $this->user_pass, 'blogname' => $this->get_blogname(), 'password_generated' => $this->password_generated, 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this));
 }
 /**
  * Get content plain.
  *
  * @return string
  */
 public function get_content_plain()
 {
     return wc_get_template_html($this->template_plain, array('order' => $this->object, 'refund' => $this->refund, 'partial_refund' => $this->partial_refund, 'email_heading' => $this->get_heading(), 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this));
 }
 /**
  * Set the list item for the selected template.
  *
  * @since   1.0.0
  *
  * @param   $item_list
  * @param   $template
  *
  * @return  string
  * @author  Alberto Ruggiero
  */
 public function ywrr_email_items_list($item_list, $template = false)
 {
     if (!$template) {
         $template = get_option('ywrr_mail_template');
     }
     if (array_key_exists($template, $this->_email_templates)) {
         $path = $this->_email_templates[$template]['path'];
         $folder = $this->_email_templates[$template]['folder'];
         $style = wc_get_template_html($folder . '/email-items-list.php', array('item_list' => $item_list), '', $path);
     } elseif (defined('YITH_WCET_PREMIUM') && get_option('ywrr_mail_template_enable') == 'yes') {
         $style = wc_get_template_html('/emails/woocommerce2.4/emails/email-items-list.php', array('item_list' => $item_list), '', YITH_WCET_TEMPLATE_PATH);
     } else {
         $style = wc_get_template_html('emails/email-items-list.php', array('item_list' => $item_list), '', YWRR_TEMPLATE_PATH);
     }
     return $style;
 }
 /**
  * Return data for script handles.
  * @access private
  * @param  string $handle
  * @return array|bool
  */
 private static function get_script_data($handle)
 {
     global $wp;
     switch ($handle) {
         case 'woocommerce':
             return array('ajax_url' => WC()->ajax_url(), 'wc_ajax_url' => WC_AJAX::get_endpoint("%%endpoint%%"));
             break;
         case 'wc-geolocation':
             return array('wc_ajax_url' => WC_AJAX::get_endpoint("%%endpoint%%"), 'home_url' => home_url(), 'is_available' => !(is_cart() || is_account_page() || is_checkout() || is_customize_preview()) ? '1' : '0', 'hash' => isset($_GET['v']) ? wc_clean($_GET['v']) : '');
             break;
         case 'wc-single-product':
             return array('i18n_required_rating_text' => esc_attr__('Please select a rating', 'woocommerce'), 'review_rating_required' => get_option('woocommerce_review_rating_required'));
             break;
         case 'wc-checkout':
             return array('ajax_url' => WC()->ajax_url(), 'wc_ajax_url' => WC_AJAX::get_endpoint("%%endpoint%%"), 'update_order_review_nonce' => wp_create_nonce('update-order-review'), 'apply_coupon_nonce' => wp_create_nonce('apply-coupon'), 'remove_coupon_nonce' => wp_create_nonce('remove-coupon'), 'option_guest_checkout' => get_option('woocommerce_enable_guest_checkout'), 'checkout_url' => WC_AJAX::get_endpoint("checkout"), 'is_checkout' => is_page(wc_get_page_id('checkout')) && empty($wp->query_vars['order-pay']) && !isset($wp->query_vars['order-received']) ? 1 : 0, 'debug_mode' => defined('WP_DEBUG') && WP_DEBUG, 'i18n_checkout_error' => esc_attr__('Error processing checkout. Please try again.', 'woocommerce'));
             break;
         case 'wc-address-i18n':
             return array('locale' => json_encode(WC()->countries->get_country_locale()), 'locale_fields' => json_encode(WC()->countries->get_country_locale_field_selectors()), 'i18n_required_text' => esc_attr__('required', 'woocommerce'));
             break;
         case 'wc-cart':
             return array('ajax_url' => WC()->ajax_url(), 'wc_ajax_url' => WC_AJAX::get_endpoint("%%endpoint%%"), 'update_shipping_method_nonce' => wp_create_nonce("update-shipping-method"));
             break;
         case 'wc-cart-fragments':
             return array('ajax_url' => WC()->ajax_url(), 'wc_ajax_url' => WC_AJAX::get_endpoint("%%endpoint%%"), 'fragment_name' => apply_filters('woocommerce_cart_fragment_name', 'wc_fragments'));
             break;
         case 'wc-add-to-cart':
             return array('ajax_url' => WC()->ajax_url(), 'wc_ajax_url' => WC_AJAX::get_endpoint("%%endpoint%%"), 'i18n_view_cart' => esc_attr__('View Cart', 'woocommerce'), 'cart_url' => apply_filters('woocommerce_add_to_cart_redirect', wc_get_cart_url()), 'is_cart' => is_cart(), 'cart_redirect_after_add' => get_option('woocommerce_cart_redirect_after_add'));
             break;
         case 'wc-add-to-cart-variation':
             return array('i18n_no_matching_variations_text' => esc_attr__('Sorry, no products matched your selection. Please choose a different combination.', 'woocommerce'), 'i18n_make_a_selection_text' => esc_attr__('Select product options before adding this product to your cart.', 'woocommerce'), 'i18n_unavailable_text' => esc_attr__('Sorry, this product is unavailable. Please choose a different combination.', 'woocommerce'), 'variation_template' => esc_attr(wc_get_template_html('single-product/add-to-cart/variation.php')));
             break;
         case 'wc-country-select':
             return array('countries' => json_encode(array_merge(WC()->countries->get_allowed_country_states(), WC()->countries->get_shipping_country_states())), 'i18n_select_state_text' => esc_attr__('Select an option…', 'woocommerce'), 'i18n_matches_1' => _x('One result is available, press enter to select it.', 'enhanced select', 'woocommerce'), 'i18n_matches_n' => _x('%qty% results are available, use up and down arrow keys to navigate.', 'enhanced select', 'woocommerce'), 'i18n_no_matches' => _x('No matches found', 'enhanced select', 'woocommerce'), 'i18n_ajax_error' => _x('Loading failed', 'enhanced select', 'woocommerce'), 'i18n_input_too_short_1' => _x('Please enter 1 or more characters', 'enhanced select', 'woocommerce'), 'i18n_input_too_short_n' => _x('Please enter %qty% or more characters', 'enhanced select', 'woocommerce'), 'i18n_input_too_long_1' => _x('Please delete 1 character', 'enhanced select', 'woocommerce'), 'i18n_input_too_long_n' => _x('Please delete %qty% characters', 'enhanced select', 'woocommerce'), 'i18n_selection_too_long_1' => _x('You can only select 1 item', 'enhanced select', 'woocommerce'), 'i18n_selection_too_long_n' => _x('You can only select %qty% items', 'enhanced select', 'woocommerce'), 'i18n_load_more' => _x('Loading more results…', 'enhanced select', 'woocommerce'), 'i18n_searching' => _x('Searching…', 'enhanced select', 'woocommerce'));
             break;
     }
     return false;
 }
 /**
  * get_content_plain function.
  *
  * @access public
  * @return string
  */
 function get_content_plain()
 {
     return wc_get_template_html($this->template_plain, array('email_heading' => $this->get_heading(), 'user_login' => $this->user_login, 'reset_key' => $this->reset_key, 'blogname' => $this->get_blogname(), 'sent_to_admin' => false, 'plain_text' => true, 'email' => $this));
 }