/**
  * widget function.
  *
  * @see WP_Widget
  *
  * @param array $args
  * @param array $instance
  *
  * @return void
  */
 public function widget($args, $instance)
 {
     global $comments;
     if ($this->get_cached_widget($args)) {
         return;
     }
     $number = !empty($instance['number']) ? absint($instance['number']) : $this->settings['number']['std'];
     $comments = get_comments(array('number' => $number, 'status' => 'approve', 'post_status' => 'publish', 'post_type' => 'product', 'meta_key' => 'is_tour_rating', 'meta_compare' => 'NOT EXISTS'));
     $content = adventure_tours_render_template_part('woocommerce/widgets/templates/recent_reviews', '', array('args' => $args, 'instance' => $instance, 'comments' => $comments), true);
     print $content;
     $this->cache_widget($args, $content);
 }
Пример #2
0
 public function render_page()
 {
     $results = array();
     $form_data = array();
     if (!empty($_GET['import'])) {
         if (!empty($_POST['import_data'])) {
             $form_data = $_POST['import_data'];
         }
         $results = $this->do_imports($form_data);
         $need_resave_permalinks = array('product', 'page', 'theme_options');
         foreach ($need_resave_permalinks as $key) {
             if (isset($results[$key])) {
                 $results[$key] .= '<br><b>NOTE:</b> Please resave your settings for section "Settings" > "Permalinks".';
                 // tmp solution to fix permalinks in case if theme options have been updated
                 //flush_rewrite_rules();
                 break;
             }
         }
     }
     adventure_tours_render_template_part('includes/admin/views/import', '', array('gateways' => $this->get_import_settings(), 'form_data' => $form_data, 'form_hidden_fields' => array('adv-demo-import-nc' => wp_create_nonce('adv-demo-import')), 'results' => $results, 'form_action' => add_query_arg(array('page' => $this->page_id, 'import' => '1'), admin_url('tools.php'))));
 }
Пример #3
0
		<meta itemprop="name" content="<?php 
the_title();
?>
">
		<meta itemprop="description" content="<?php 
echo esc_attr(adventure_tours_get_short_description(null, 300));
?>
">
		<meta itemprop="url" content="<?php 
echo esc_url($tour_permalink);
?>
">
		<?php 
adventure_tours_render_template_part('templates/parts/scheme-price', '', array('product' => $product));
adventure_tours_render_template_part('templates/parts/scheme-rating', '', array('product' => $product));
?>
		<?php 
if ($tour_thumbnail_url) {
    ?>
			<meta itemprop="image" content="<?php 
    echo esc_url($tour_thumbnail_url);
    ?>
">
		<?php 
}
?>
		<?php 
if (comments_open()) {
    comments_template();
}
Пример #4
0
 * @package   Themedelight/AdventureTours
 * @version   1.0.0
 */
if (is_404()) {
    return;
}
$section_meta_service = adventure_tours_di('header_section');
$section_meta = $section_meta_service ? $section_meta_service->get_section_meta() : array();
// $mode == 'hide' means "default" mode.
$mode = isset($section_meta['section_mode']) ? $section_meta['section_mode'] : 'hide';
if ('banner' == $mode && empty($section_meta['banner_image'])) {
    $mode = 'hide';
}
if ('hide' == $mode) {
    // To hide default title for home page.
    if (is_front_page()) {
        return;
    }
}
switch ($mode) {
    case 'banner':
        adventure_tours_render_template_part('templates/header/banner', '', $section_meta);
        break;
    case 'slider':
        adventure_tours_render_template_part('templates/header/slider', '', $section_meta);
        break;
    case 'hide':
    default:
        adventure_tours_render_template_part('templates/header/title-block', '', $section_meta);
        break;
}
Пример #5
0
		<?php 
    woocommerce_product_loop_end();
    ?>
		<?php 
    do_action('woocommerce_after_shop_loop');
    ?>
	<?php 
} elseif (!woocommerce_product_subcategories(array('before' => woocommerce_product_loop_start(false), 'after' => woocommerce_product_loop_end(false)))) {
    ?>
		<?php 
    wc_get_template('loop/no-products-found.php');
    ?>
	<?php 
}
?>
	<?php 
/**
 * woocommerce_after_main_content hook
 *
 * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
 */
do_action('woocommerce_after_main_content');
$primary_content = ob_get_clean();
?>

<?php 
adventure_tours_render_template_part('templates/layout', '', array('content' => $primary_content, 'sidebar' => $sidebar_content));
?>

<?php 
get_footer('shop');
Пример #6
0
    if (isset($nonce_field['name']) && isset($nonce_field['value'])) {
        wp_nonce_field($nonce_field['value'], $nonce_field['name']);
    }
    ?>
						<input type="hidden" name="booking_tour_id" value="<?php 
    the_ID();
    ?>
" />
						<span class="description"><?php 
    esc_html_e('Please add ranges with information about tour dates.', 'adventure-tours');
    ?>
</span>
					</th>
				</tr>
			</tfoot>
			<tbody id="tour_booking_rows_cont">
			<?php 
    if ($periods && is_array($periods)) {
        foreach ($periods as $curIndex => $row) {
            adventure_tours_render_template_part($row_template, '', array('row' => $row, 'rowIndex' => $curIndex));
        }
    }
    ?>
			</tbody>
		</table>
	</div>
<?php 
}
?>
</div>
Пример #7
0
 * Page header view for the banner mode.
 *
 * @var string $title
 * @var string $section_mode
 * @var string $slider_alias
 * @var string $banner_subtitle
 * @var string $banner_image
 * @var string $is_banner_image_parallax
 * @var string $banner_image_repeat
 * @var string $banner_mask
 *
 * @author    Themedelight
 * @package   Themedelight/AdventureTours
 * @version   1.0.7
 */
$breadcrumbs_html = adventure_tours_render_template_part('templates/header/breadcrumbs', '', array(), true);
$is_use_parallax = isset($is_banner_image_parallax) && $is_banner_image_parallax;
$is_image = $banner_image && !$is_use_parallax;
$is_banner_paralax = $is_use_parallax && $banner_image;
$mask_html = !empty($banner_mask) ? sprintf('<div class="header-section-mask %s"></div>', esc_attr('header-section-mask--' . $banner_mask)) : '';
adventure_tours_di('register')->setVar('is_banner', true);
$wrapper_additional_class = $is_banner_paralax ? ' parallax-section parallax-section--header' : '';
if ($banner_mask) {
    $wrapper_additional_class .= esc_attr(' header-section--with-mask-' . $banner_mask);
}
?>

<div class="header-section header-section--with-banner<?php 
print $wrapper_additional_class;
?>
">
Пример #8
0
 /**
  * Returns the booking form html.
  *
  * @param  WC_Product_Tour $product
  * @param  assoc           $options additional options that will be passed to view via "option" argument.
  * @return string
  */
 public function render($product = null, $options = array())
 {
     if (null == $product) {
         $product = wc_get_product();
     }
     if (!$this->is_active($product)) {
         return '';
     }
     return adventure_tours_render_template_part($this->view_file, '', $this->get_view_params($product, $options), true);
 }
 /**
  * Renders Tour Booking management tab on the product management page.
  *
  * @return void
  */
 public function filter_woocommerce_product_write_panels()
 {
     wp_enqueue_script('theme-tools', PARENT_URL . '/assets/js/ThemeTools.js', array('jquery'), '1.0.0');
     wp_enqueue_script('tour-booking-tab', PARENT_URL . '/assets/js/AdminTourBookingTab.js', array('jquery'), '1.0.0');
     global $post;
     adventure_tours_render_template_part('templates/admin/tour-booking-tab', '', array('periods' => adventure_tours_di('tour_booking_service')->get_rows($post->ID), 'product_translation' => $this->is_product_translation(), 'disable_ajax_saving' => adventure_tours_check('is_wpml_in_use'), 'nonce_field' => array('name' => self::$booking_form_nonce_field_name, 'value' => self::$booking_form_nonce_key)));
 }
Пример #10
0
 public function widget($args, $instance)
 {
     adventure_tours_render_template_part('templates/widgets/tours', '', array('widget_args' => $args, 'settings' => $instance, 'items' => adventure_tours_di('shortcodes_helper')->get_tours_collection($instance)));
 }
Пример #11
0
 /**
  * Tour details page, tab description rendeing function.
  *
  * @return void
  */
 function adventure_tours_render_tab_description()
 {
     global $product;
     if (adventure_tours_check('tour_category_taxonomy_exists')) {
         $taxonomy = 'tour_category';
         $terms = get_the_terms($product->ID, $taxonomy);
         if ($terms) {
             echo '<ul class="list-block list-block--tour-tabs">';
             foreach ($terms as $term) {
                 echo '<li><a href="' . get_term_link($term->slug, $taxonomy) . '">' . $term->name . '</a></li>';
             }
             echo '</ul>';
         }
     }
     the_content();
     if (!empty($GLOBALS['_tour_additional_attributes'])) {
         adventure_tours_render_template_part('templates/tour/additional-attributes', '', array('title' => esc_html__('Additional information', 'adventure-tours'), 'attributes' => $GLOBALS['_tour_additional_attributes']));
     }
 }
Пример #12
0
            $plain_price_data['display_regular_price'] = (double) $WOOCS->raw_woocommerce_price($plain_price_data['display_regular_price']);
        }
    }
}
TdJsClientScript::addScript('money_formatting_config', 'Theme.formatter.setConfig("money",' . wp_json_encode(array('mask' => sprintf(get_woocommerce_price_format(), get_woocommerce_currency_symbol(), '{amount}'), 'decimal_separator' => wc_get_price_decimal_separator(), 'thousand_separator' => wc_get_price_thousand_separator(), 'decimals' => wc_get_price_decimals())) . ');');
wp_enqueue_script('jquery-ui-datepicker');
wp_enqueue_style('jquery-ui-datepicker-custom');
TdJsClientScript::addScript('initTourBookingForm', 'Theme.tourBookingForm.init(' . wp_json_encode(array('formSelector' => '#tourBookingForm', 'availableDates' => $booking_form->get_booking_dates($product, true), 'dateFormat' => $booking_form->get_date_format('datepicker'), 'plainPriceData' => $plain_price_data, 'variationsData' => $config_variations_data, 'disableAjax' => 'yes' != get_option('woocommerce_enable_ajax_add_to_cart'), 'dateCalendarAvailableTicketsMessage' => $booking_form->calendar_show_left_tickets_format, 'timeSeletTextFormat' => $booking_form->time_select_text_format, 'useDatePickerForDateSelection' => $booking_form->user_datepicker_for_date_field, 'itemsDataPriceUrl' => admin_url('admin-ajax.php?action=calculate_booking_items_price'))) . ');');
?>

<a name="tourBooking"></a>
<?php 
$notices = apply_filters('adventure_tours_booking_form_notices', array());
if ($notices) {
    foreach ($notices as $notice_type => $messages) {
        adventure_tours_render_template_part('templates/parts/notices', '', array('messages' => $messages, 'type' => $notice_type));
    }
}
?>
<div class="form-block form-block--style3 form-block--tour-booking block-after-indent">
<?php 
$form_title = apply_filters('adventure_tours_booking_form_title', esc_html__('Book the tour', 'adventure-tours'), $product);
if ($form_title) {
    printf('<h3 class="form-block__title">%s</h3>', esc_html($form_title));
}
?>
	<form id="tourBookingForm" method="POST">
		<?php 
echo $rendererer->render();
?>
Пример #13
0
<?php

/**
 * Tour category template.
 *
 * @author    Themedelight
 * @package   Themedelight/AdventureTours
 * @version   1.0.0
 */
adventure_tours_render_template_part('templates/tour/archive');
Пример #14
0
	<td>
		<div>
			<?php 
$times = isset($row['times']) ? $row['times'] : array();
$prices = isset($row['prices']) ? $row['prices'] : array();
foreach ($times as $_tindex => $_time) {
    echo adventure_tours_render_template_part($time_template, '', array('value' => $_time, 'price_value' => isset($prices[$_tindex]) ? $prices[$_tindex] : '', 'row_field_name' => $row_field_name), true);
}
?>
			<a href="#" class="button button-primary add_time_btn"><?php 
esc_html_e('Add Time', 'adventure-tours');
?>
</a>
			<script data-role="time-template" type="text/template">
			<?php 
echo adventure_tours_render_template_part($time_template, '', array('value' => '', 'row_field_name' => $row_field_name), true);
?>
			</script>
		</div>
	</td>
	<td>
		<div class="tour-booking-row__cell">
			<div><?php 
esc_html_e('Number of tickets per tour', 'adventure-tours');
?>
</div>
			<input type="text" name="<?php 
echo esc_attr($row_field_name);
?>
[limit]" style="width:60px;" value="<?php 
echo isset($row['limit']) ? esc_attr($row['limit']) : '1';