コード例 #1
0
ファイル: woocommerce.php プロジェクト: j-kenneth/Expeero
function adventure_tours_init_select2()
{
    wp_enqueue_script('select2');
    wp_enqueue_style('select2', str_replace(array('http:', 'https:'), '', WC()->plugin_url()) . '/assets/' . 'css/select2.css');
    // .shipping_method, #calc_shipping_state selectors for selects shipping methods
    // if elements not dom, select2 throw exception "Uncaught query function not defined for Select2" and rendering stopped for next elements in jQuery collections
    TdJsClientScript::addScript('initSelect2', 'jQuery(".country_to_state, .select2-selector").select2();');
}
コード例 #2
0
$loop = 0;
$columns = apply_filters('woocommerce_product_thumbnails_columns', 3);
?>
<div class="row product-thumbnails <?php 
echo 'columns-' . $columns;
?>
"><?php 
foreach ($attachment_ids as $attachment_id) {
    $classes = array('swipebox');
    if ($loop == 0 || $loop % $columns == 0) {
        $classes[] = 'first';
    }
    if (($loop + 1) % $columns == 0) {
        $classes[] = 'last';
    }
    $image_link = wp_get_attachment_url($attachment_id);
    if (!$image_link) {
        continue;
    }
    $image = wp_get_attachment_image($attachment_id, apply_filters('single_product_small_thumbnail_size', 'shop_thumbnail'));
    $image_class = esc_attr(implode(' ', $classes));
    $image_title = esc_attr(get_the_title($attachment_id));
    echo apply_filters('woocommerce_single_product_image_thumbnail_html', sprintf('<div class="col-sm-3 col-xs-4 product-thumbnails__item"><a href="%s" class="%s" title="%s">%s</a></div>', $image_link, $image_class, $image_title, $image), $attachment_id, $post->ID, $image_class);
    $loop++;
}
?>
</div><?php 
wp_enqueue_style('swipebox');
wp_enqueue_script('swipebox');
TdJsClientScript::addScript('initProductSwipebox', "jQuery('.woocommerce-main-image.swipebox,.product-thumbnails .swipebox').swipebox({useSVG : true, hideBarsDelay : 0});");
コード例 #3
0
ファイル: share-buttons.php プロジェクト: j-kenneth/Expeero
<?php

/**
 * Post sharing buttons rendering template part.
 *
 * @author    Themedelight
 * @package   Themedelight/AdventureTours
 * @version   1.0.9
 */
$sharrePluginConfig = array('itemsSelector' => '.share-buttons__item[data-btntype]');
wp_enqueue_script('sharrre');
TdJsClientScript::addScript('sharreInit', 'Theme.initSharrres(' . wp_json_encode($sharrePluginConfig) . ');');
?>
<div class="share-buttons" data-urlshare="<?php 
echo esc_url(get_permalink());
?>
">
<?php 
if (adventure_tours_get_option('social_sharing_googleplus')) {
    ?>
	<div class="share-buttons__item share-buttons__item--googleplus" data-btntype="googlePlus"></div>
<?php 
}
if (adventure_tours_get_option('social_sharing_facebook')) {
    ?>
	<div class="share-buttons__item share-buttons__item--facebook" data-btntype="facebook"></div>
<?php 
}
if (adventure_tours_get_option('social_sharing_twitter')) {
    ?>
	<div class="share-buttons__item share-buttons__item--twitter" data-btntype="twitter"></div>
コード例 #4
0
 * @package   Themedelight/AdventureTours
 * @version   1.2.4
 */
if (!$items) {
    return;
}
$slider_id = 'swiper' . adventure_tours_di('shortcodes_helper')->generate_id();
wp_enqueue_style('swiper');
wp_enqueue_script('swiper');
$cfg_var_name = '_ticCfg' . $slider_id;
if (!isset($slides_number) || $slides_number < 1) {
    $slides_number = 5;
} elseif ($slides_number > 6) {
    $slides_number = 6;
}
TdJsClientScript::addScript('toursTypeIconsSliderInit' . $slider_id, 'var ' . $cfg_var_name . ' = ' . wp_json_encode(array('containerSelector' => '#' . $slider_id, 'slidesNumber' => $slides_number, 'navPrevSelector' => '.tours-type-icons__slider__prev', 'navNextSelector' => '.tours-type-icons__slider__next')) . ';' . $cfg_var_name . '.widthToSlidesNumber = function(windowWidth, slidesPerView){ if (windowWidth < 390) return 1; else if (windowWidth < 581) return 2; else if (windowWidth < 768) return 3; return slidesPerView; };' . 'Theme.makeSwiper(' . $cfg_var_name . ');');
?>
<div id="<?php 
echo esc_attr($slider_id);
?>
" class="tours-type-icons padding-top-large padding-bottom-large<?php 
if ($css_class) {
    echo esc_attr(' ' . $css_class);
}
?>
">
<?php 
if ($bg_url) {
    ?>
	<div class="tours-type-icons__bg" style="background:url(<?php 
    echo esc_url($bg_url);
コード例 #5
0
ファイル: default.php プロジェクト: j-kenneth/Expeero
 *
 * @var string $galleryId
 * @var bool   $is_filter
 * @var bool   $is_pagination
 * @var array  $full_categories_list contains categories for all images
 * @var array  $gallery_images contains information about the picture, obtained from adventure-tours-post-gallery-filter.php
 *             Contains: link_full, link_custom_size, title, alt, (array) $categories slug => name.
 *
 * @author    Themedelight
 * @package   Themedelight/AdventureTours
 * @version   1.0.0
 */
// wp_enqueue_style( 'animate' );
wp_enqueue_style('swipebox');
wp_enqueue_script('swipebox');
TdJsClientScript::addScript('initGallery_' . $galleryId, 'new Theme.Gallery("#' . $galleryId . '");');
?>

<div class="row gallery__items">
	<?php 
foreach ($gallery_images as $image) {
    ?>
		<?php 
    $dataFilters = '';
    $category = '';
    if (!empty($image['categories'])) {
        foreach ($image['categories'] as $slug => $name) {
            $dataFilters .= ' ' . $slug;
            $category .= ' ' . $name;
        }
    }
コード例 #6
0
ファイル: header.php プロジェクト: j-kenneth/Expeero
<?php

/**
 * Header template part.
 *
 * @author    Themedelight
 * @package   Themedelight/AdventureTours
 * @version   1.0.9
 */
get_template_part('header', 'clean');
$is_sticky_header = adventure_tours_get_option('sticky-header');
if ($is_sticky_header) {
    TdJsClientScript::addScript('sticky-header', 'Theme.initStickyHeader();');
    echo '<div class="header-wrap"><div class="header-wrap__backlog"></div>';
}
?>
<header class="header" role="banner">
	<div class="container">
		<?php 
get_template_part('templates/header/info');
?>
		<div class="header__content-wrap">
			<div class="row">
				<div class="col-md-12 header__content">
					<?php 
get_template_part('templates/header/logo');
?>
					<?php 
if (has_nav_menu('header-menu')) {
    ?>
					<nav class="main-nav-header" role="navigation">
コード例 #7
0
ファイル: banner.php プロジェクト: j-kenneth/Expeero
$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;
?>
">
<?php 
if ($is_banner_paralax) {
    wp_enqueue_script('parallax');
    TdJsClientScript::addScript('initParallax', 'Theme.initParallax();');
    printf('%s<div class="parallax-image" style="background-image:url(%s);%s"></div>', $mask_html, esc_url($banner_image), $banner_image_repeat ? ' background-repeat:' . esc_attr($banner_image_repeat) . ';' : '');
}
?>
	<div class="container">
		<?php 
print $breadcrumbs_html;
?>
		<div class="header-section__content">
			<h1 class="header-section__title"><?php 
echo esc_html($title);
?>
</h1>
		<?php 
if ($banner_subtitle) {
    ?>
コード例 #8
0
    public function init_js_errors($items_selector)
    {
        if (!$items_selector) {
            return;
        }
        TdJsClientScript::addScript('initValidationBookTour', <<<SCRIPT
\t\t\tTheme.FormValidationHelper
\t\t\t\t.initTooltip('{$items_selector}')
\t\t\t\t.addClass('form-validation-item')
\t\t\t\t.tooltip('show');
SCRIPT
);
    }
コード例 #9
0
ファイル: search.php プロジェクト: j-kenneth/Expeero
<?php

/**
 * Page header template part for the search field rendering.
 *
 * @author    Themedelight
 * @package   Themedelight/AdventureTours
 * @version   1.0.0
 */
if (!adventure_tours_get_option('show_header_search')) {
    return '';
}
// as in this case link tag will be placed to body withou property='stylesheet' attribute
// that makes html validation error
// wp_enqueue_style( 'magnific-popup' );
// wp_enqueue_script( 'magnific-popup' );
TdJsClientScript::addScript('initSerchFormPopup', 'Theme.initSerchFormPopup(' . wp_json_encode(array('placeholder_text' => esc_html__('Type in your request...', 'adventure-tours'))) . ');');
?>
<div class="header__info__item header__info__item--delimiter header__info__item--search"><a href="#search-form-header" class="popup-search-form" data-effect="mfp-zoom-in"><i class="fa fa-search"></i></a></div>

<div id="search-form-header" class="search-form-popup search-form-popup--hide mfp-with-anim mfp-hide ">
	<?php 
get_search_form();
?>
</div>
コード例 #10
0
 /**
  * Filter function for 'custom_menu_order' filter.
  * Used for adding new items to 'Products' section and making custom order for them.
  *
  * @param  boolean $order flag that indicates that custom order should be used.
  * @return boolean
  */
 public function filter_custom_menu_order($order)
 {
     $icons_storage = adventure_tours_di('product_attribute_icons_storage');
     if ($icons_storage && $icons_storage->is_active()) {
         include_once dirname(__FILE__) . '/WC_Admin_Attributes_Extended.php';
         $extender = new WC_Admin_Attributes_Extended(array('storage' => $icons_storage));
         $extender->hook();
     }
     global $submenu;
     if (!empty($submenu['edit.php?post_type=product'])) {
         $productsMenu =& $submenu['edit.php?post_type=product'];
         array_unshift($productsMenu, array(esc_html__('Tours', 'adventure-tours'), 'edit_products', 'edit.php?post_type=product&product_type=tour&is_tours_management=1'));
     }
     // if currently loaded page is tours management section - adding js that highlight it as active menu item
     // as WP does not provide any other way to have few edit section for same custom post type
     // need improve this
     if (!empty($_GET['is_tours_management'])) {
         TdJsClientScript::addScript('activateTourItemMenu', $this->generate_tour_activation_js());
     } else {
         add_filter('admin_footer-post.php', array($this, 'filter_admin_footer_for_menu_activation'));
     }
     return $order;
 }
コード例 #11
0
 */
if (!$items) {
    return;
}
if (!isset($slides_number)) {
    $slides_number = 3;
}
if ($slides_number < 1) {
    $slides_number = 3;
} elseif ($slides_number > 6) {
    $slides_number = 6;
}
$slider_id = 'swiper' . adventure_tours_di('shortcodes_helper')->generate_id();
wp_enqueue_style('swiper');
wp_enqueue_script('swiper');
TdJsClientScript::addScript('shortocdeProductSliderInit' . $slider_id, 'Theme.makeSwiper(' . wp_json_encode(array('containerSelector' => '#' . $slider_id, 'slidesNumber' => $slides_number, 'navPrevSelector' => '.atgrid__slider__prev', 'navNextSelector' => '.atgrid__slider__next')) . ');');
if ($image_size_mobile && wp_is_mobile()) {
    $image_size = $image_size_mobile;
}
$placeholder_image = adventure_tours_placeholder_img($image_size);
$element_css_class = 'atgrid' . ($bg_url ? ' padding-top-large padding-bottom-large' : '') . ($css_class ? ' ' . $css_class : '');
if ($slides_number > 3) {
    $element_css_class .= ' atgrid--small';
}
?>
<div id="<?php 
echo esc_attr($slider_id);
?>
" class="<?php 
echo esc_attr($element_css_class);
?>
コード例 #12
0
 public static function getFooterScriptsText($withoutReset = false)
 {
     $result = '';
     if (self::$footerScriptFiles) {
         foreach (self::$footerScriptFiles as $url) {
             $result .= '<script type="text/javascript" src="' . $url . '"></script>' . "\n";
         }
         if (!$withoutReset) {
             self::$footerScriptFiles = array();
         }
     }
     if (self::$footerScripts) {
         foreach (self::$footerScripts as $jsCode) {
             $result .= '<script type="text/javascript">' . $jsCode . '</script>' . "\n";
         }
         if (!$withoutReset) {
             self::$footerScripts = array();
         }
     }
     if ($onReadyScript = self::getOnReadyScriptText($withoutReset)) {
         $result .= '<script type="text/javascript">' . $onReadyScript . '</script>' . "\n";
     }
     return $result;
 }
コード例 #13
0
 /**
  * Tour details page, tab photos rendeing function.
  *
  * @return void
  */
 function adventure_tours_render_tab_photos()
 {
     $thumbnail = adventure_tours_get_the_post_thumbnail();
     if ($thumbnail) {
         wp_enqueue_style('swipebox');
         wp_enqueue_script('swipebox');
         TdJsClientScript::addScript('initProductSwiper', "jQuery('.woocommerce-main-image.swipebox,.thumbnails .swipebox').swipebox({useSVG : true, hideBarsDelay : 0});");
         echo sprintf('<div class="row product-thumbnails"><div class="col-md-12"><a href="%s" class="swipebox" title="%s">%s</a></div></div>', esc_url(wp_get_attachment_url(get_post_thumbnail_id())), esc_attr(get_the_title()), $thumbnail);
     }
     woocommerce_show_product_thumbnails();
 }
コード例 #14
0
ファイル: template-faq.php プロジェクト: j-kenneth/Expeero
<?php

/**
 * Template Name: FAQ
 *
 * @author    Themedelight
 * @package   Themedelight/AdventureTours
 * @version   1.1.2
 */
get_header();
$cat_tax_name = 'faq_category';
$mode_all = false;
$cat_taxonomies = array();
TdJsClientScript::addScript('faqAccorsionChagesIconInit', 'Theme.faqAccordionCahgesIcon();');
$is_sidebar = is_active_sidebar('faq-sidebar');
$show_question_form = adventure_tours_get_option('faq_show_question_form');
$is_show_col = $is_sidebar || $show_question_form;
$accordion_id = 1;
$accordion_item_id = 1;
if (adventure_tours_check('faq_taxonomies')) {
    if (is_tax($cat_tax_name)) {
        // query for particular category
        $cur_category = get_queried_object();
        if ($cur_category) {
            $cat_taxonomies[] = $cur_category;
        }
    } elseif (have_posts()) {
        // page template is used
        $mode_all = true;
        the_post();
        $cat_taxonomies = get_terms($cat_tax_name);
コード例 #15
0
ファイル: google_map.php プロジェクト: j-kenneth/Expeero
<?php

/**
 * Shortcode [google_map] view.
 * For more detailed list see list of shortcode attributes.
 *
 * @var string $address
 * @var string $coordinates
 * @var string $zoom
 * @var string $height
 * @var string $width_mode
 * @var string $css_class
 * @var string $view
 *
 * @author    Themedelight
 * @package   Themedelight/AdventureTours
 * @version   1.0.0
 */
$instance_id = adventure_tours_di('shortcodes_helper')->generate_id();
$element_id = 'googleMapCanvas' . $instance_id;
$config_json = wp_json_encode(array('coordinates' => explode(',', $coordinates), 'zoom' => (int) $zoom, 'address' => $address, 'height' => $height, 'element_id' => $element_id, 'full_width' => 'full-width' == $width_mode, 'is_reset_map_fix_for_bootstrap_tabs_accrodion' => true));
TdJsClientScript::addScriptScriptFile('googleMapScript', 'https://maps.google.com/maps/api/js?sensor=true');
TdJsClientScript::addScript('initGoogleMap' . $instance_id, 'Theme.initGoogleMap(' . $config_json . ');', TdJsClientScript::POS_FOOTER);
printf('<div id="%s" class="google-map%s"></div>', esc_attr($element_id), $css_class ? esc_attr(' ' . $css_class) : '');
コード例 #16
0
 *
 * @var string $form_action       value for action attribute
 * @var assoc  $form_data         form values
 * @var assoc  $nonce_field       settings for nonce field
 * @var assoc  $state_hash_field
 * @var string $email
 * @var string $email_subject
 * @var string $email_view
 * @var string $css_class
 * @var string $view
 *
 * @author    Themedelight
 * @package   Themedelight/AdventureTours
 * @version   1.3.0
 */
TdJsClientScript::addScript('initFaqQuestionForm', 'Theme.init_faq_question_form(".faq-question-form");');
?>
<form class="faq-question-form<?php 
if (!empty($css_class)) {
    echo ' ' . esc_attr($css_class);
}
?>
" action="<?php 
echo esc_url($form_action);
?>
" method="post">
	<div class="form-block__item">
		<input type="text" name="question[name]" class="form-validation-item" placeholder="<?php 
esc_attr_e('Name', 'adventure-tours');
?>
" value="<?php 
コード例 #17
0
 * @author    Themedelight
 * @package   Themedelight/AdventureTours
 * @version   1.2.4
 */
if (!$items) {
    return;
}
if (!isset($slides_number) || $slides_number < 1) {
    $slides_number = 4;
} elseif ($slides_number > 6) {
    $slides_number = 6;
}
$slider_id = 'swiper' . adventure_tours_di('shortcodes_helper')->generate_id();
wp_enqueue_style('swiper');
wp_enqueue_script('swiper');
TdJsClientScript::addScript('toursTypeSliderInit' . $slider_id, 'Theme.makeSwiper(' . wp_json_encode(array('containerSelector' => '#' . $slider_id, 'slidesNumber' => $slides_number, 'navPrevSelector' => '.tours-type__slider__prev', 'navNextSelector' => '.tours-type__slider__next')) . ');');
?>
<div id="<?php 
echo esc_attr($slider_id);
?>
" class="tours-type<?php 
if ($css_class) {
    echo esc_attr(' ' . $css_class);
}
?>
">
	<?php 
if ($title || $sub_title) {
    echo do_shortcode('[title text="' . addslashes($title) . '" subtitle="' . addslashes($sub_title) . '" size="big" position="center" decoration="on" underline="' . addslashes($title_underline) . '" style="dark"]');
}
?>
コード例 #18
0
    if ($WOOCS->default_currency != $WOOCS->current_currency && !$WOOCS->is_multiple_allowed) {
        if ($config_variations_data) {
            foreach ($config_variations_data as &$_variation_details) {
                $_variation_details['display_price'] = (double) $WOOCS->raw_woocommerce_price($_variation_details['display_price']);
                $_variation_details['display_regular_price'] = (double) $WOOCS->raw_woocommerce_price($_variation_details['display_regular_price']);
            }
        } elseif ($plain_price_data) {
            $plain_price_data['display_price'] = (double) $WOOCS->raw_woocommerce_price($plain_price_data['display_price']);
            $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) {