function kt_advanced_search_query($query) { if ($query->is_search() && kt_is_wc()) { // tag search if (isset($_GET['cat']) && $_GET['cat']) { $taxquery = array(array('taxonomy' => 'product_cat', 'field' => 'term_id', 'terms' => array($_GET['cat']), 'operator' => 'IN'), 'relation' => 'OR'); $query->tax_query = $taxquery; $query->query_vars['tax_query'] = $query->tax_query; } return $query; } }
do_action('kt_mini_cart'); } ?> </div> </div> <!-- END MANIN HEADER --> <div id="nav-top-menu" class="nav-top-menu"> <div class="container"> <?php do_action('kt_show_menu_option_1'); ?> <!-- userinfo on top--> <div id="form-search-opntop"> </div> <?php if (kt_is_wc()) { ?> <!-- CART ICON ON MMENU --> <div id="shopping-cart-box-ontop"> <i class="fa fa-shopping-cart"></i> <div class="shopping-cart-box-ontop-content"></div> </div> <?php } ?> </div> </div> <div class="container"> <div class="divider main-bg"></div> </div> </div>
<?php if (kt_is_wc() && kt_option('header_cart', 1)) { ?> <div class="shopping-bag shopping-bag-wishlist"> <?php kt_woocommerce_get_wishlist(); ?> </div> <?php }
<?php // Exit if accessed directly if (!defined('ABSPATH')) { exit; } if (!kt_is_wc()) { return; } vc_map(array("name" => __("Categories Tab", THEME_LANG), "base" => "categories_tab", "category" => __('Kute Theme', THEME_LANG), "description" => __("Show tab categories", THEME_LANG), "as_parent" => array('only' => 'tab_section'), "content_element" => true, "show_settings_on_create" => true, "params" => array(array("type" => "textfield", "heading" => __("Title", THEME_LANG), "param_name" => "title", "admin_label" => true), array("type" => "textfield", "heading" => __("Number Post", THEME_LANG), "param_name" => "per_page", 'std' => 10, "admin_label" => false, 'description' => __('Number post in a slide', THEME_LANG)), array("type" => "textfield", "heading" => __("Column", THEME_LANG), "param_name" => "number_column", "admin_label" => false, 'std' => 4, 'description' => __('Number column display', THEME_LANG)), array("type" => "dropdown", "heading" => __("Tabs Type", THEME_LANG), "param_name" => "tabs_type", "admin_label" => true, 'std' => 'tabs1', 'value' => array(__('Tab 1', THEME_LANG) => 'tab-1', __('Tab 2', THEME_LANG) => 'tab-2', __('Tab 3', THEME_LANG) => 'tab-3', __('Tab 4', THEME_LANG) => 'tab-4', __('Tab 5', THEME_LANG) => 'tab-5', __('Tab 6', THEME_LANG) => 'tab-6', __('Tab 7', THEME_LANG) => 'tab-7')), array("type" => "kt_categories", "heading" => __("Choose Category", THEME_LANG), "param_name" => "category", "admin_label" => true), array("type" => "colorpicker", "heading" => __("Main Color", THEME_LANG), "param_name" => "main_color", "admin_label" => true), array('type' => 'attach_image', 'heading' => __('Icon', THEME_LANG), 'param_name' => 'icon', "dependency" => array("element" => "tabs_type", "value" => array('tab-1', 'tab-2', 'tab-3', 'tab-4', 'tab-5')), 'description' => __('Setup icon for the tab', THEME_LANG)), array('type' => 'attach_images', 'heading' => __('Banner top', THEME_LANG), 'param_name' => 'banner_top', "dependency" => array("element" => "tabs_type", "value" => array('tab-1')), 'description' => __('Setup image on top of the tab', THEME_LANG)), array('type' => 'attach_images', 'heading' => __('Banner left', THEME_LANG), 'param_name' => 'banner_left', "dependency" => array("element" => "tabs_type", "value" => array('tab-1', 'tab-2', 'tab-3', 'tab-4', 'tab-5')), 'description' => __('Setup image on left of the tab', THEME_LANG)), array('type' => 'checkbox', 'heading' => __('Featured', THEME_LANG), 'param_name' => 'featured', "dependency" => array("element" => "tabs_type", "value" => array('tab-1')), 'description' => __('Setup image on left of the tab', THEME_LANG), 'value' => array(__('Yes', THEME_LANG) => 'yes')), array('type' => 'dropdown', 'heading' => __('CSS Animation', 'js_composer'), 'param_name' => 'css_animation', 'admin_label' => false, 'value' => array(__('No', 'js_composer') => '', __('Top to bottom', 'js_composer') => 'top-to-bottom', __('Bottom to top', 'js_composer') => 'bottom-to-top', __('Left to right', 'js_composer') => 'left-to-right', __('Right to left', 'js_composer') => 'right-to-left', __('Appear from center', 'js_composer') => "appear"), 'description' => __('Select type of animation if you want this element to be animated when it enters into the browsers viewport. Note: Works only in modern browsers.', 'js_composer')), array('type' => 'checkbox', 'heading' => __('AutoPlay', THEME_LANG), 'param_name' => 'autoplay', 'value' => array(__('Yes, please', THEME_LANG) => 'true'), 'group' => __('Carousel settings', THEME_LANG), 'admin_label' => false, "dependency" => array("element" => "tabs_type", "value" => array('tab-1'))), array('type' => 'checkbox', 'heading' => __('Navigation', THEME_LANG), 'param_name' => 'navigation', 'value' => array(__("Don't use Navigation", THEME_LANG) => 'false'), 'description' => __("Don't display 'next' and 'prev' buttons.", THEME_LANG), 'group' => __('Carousel settings', THEME_LANG), 'admin_label' => false, "dependency" => array("element" => "tabs_type", "value" => array('tab-1'))), array('type' => 'checkbox', 'heading' => __('Loop', THEME_LANG), 'param_name' => 'loop', 'value' => array(__("Loop", THEME_LANG) => 'false'), 'description' => __("Inifnity loop. Duplicate last and first items to get loop illusion.", THEME_LANG), 'group' => __('Carousel settings', THEME_LANG), 'admin_label' => false, "dependency" => array("element" => "tabs_type", "value" => array('tab-1'))), array("type" => "kt_number", "heading" => __("Slide Speed", THEME_LANG), "param_name" => "slidespeed", "value" => "250", "suffix" => __("milliseconds", THEME_LANG), "description" => __('Slide speed in milliseconds', THEME_LANG), 'group' => __('Carousel settings', THEME_LANG), 'admin_label' => false, "dependency" => array("element" => "tabs_type", "value" => array('tab-1'))), array("type" => "kt_number", "heading" => __("Margin", THEME_LANG), "param_name" => "margin", "value" => "0", "suffix" => __("px", THEME_LANG), "description" => __('Distance( or space) between 2 item', THEME_LANG), 'group' => __('Carousel settings', THEME_LANG), 'admin_label' => false, "dependency" => array("element" => "tabs_type", "value" => array('tab-1'))), array('type' => 'checkbox', 'heading' => __('Don\'t Use Carousel Responsive', THEME_LANG), 'param_name' => 'use_responsive', 'value' => array(__("Don't use Responsive", THEME_LANG) => 'false'), 'description' => __("Try changing your browser width to see what happens with Items and Navigations", THEME_LANG), 'group' => __('Carousel responsive', THEME_LANG), 'admin_label' => false, "dependency" => array("element" => "tabs_type", "value" => array('tab-1'))), array("type" => "kt_number", "heading" => __("The items on destop (Screen resolution of device >= 992px )", THEME_LANG), "param_name" => "items_destop", "value" => "4", "suffix" => __("item", THEME_LANG), "description" => __('The number of items on destop', THEME_LANG), 'group' => __('Carousel responsive', THEME_LANG), 'admin_label' => false, "dependency" => array("element" => "tabs_type", "value" => array('tab-1'))), array("type" => "kt_number", "heading" => __("The items on tablet (Screen resolution of device >=768px and < 992px )", THEME_LANG), "param_name" => "items_tablet", "value" => "2", "suffix" => __("item", THEME_LANG), "description" => __('The number of items on destop', THEME_LANG), 'group' => __('Carousel responsive', THEME_LANG), 'admin_label' => false, "dependency" => array("element" => "tabs_type", "value" => array('tab-1'))), array("type" => "kt_number", "heading" => __("The items on mobile (Screen resolution of device < 768px)", THEME_LANG), "param_name" => "items_mobile", "value" => "1", "suffix" => __("item", THEME_LANG), "description" => __('The numbers of item on destop', THEME_LANG), 'group' => __('Carousel responsive', THEME_LANG), 'admin_label' => false, "dependency" => array("element" => "tabs_type", "value" => array('tab-1'))), array('type' => 'css_editor', 'heading' => __('Css', 'js_composer'), 'param_name' => 'css', 'group' => __('Design options', 'js_composer'), 'admin_label' => false)), "js_view" => 'VcColumnView')); vc_map(array("name" => __("Section Tab", THEME_LANG), "base" => "tab_section", "content_element" => true, "as_child" => array('only' => 'categories_tab'), "params" => array(array("type" => "textfield", "heading" => __("Header", THEME_LANG), "param_name" => "header", "admin_label" => true), array("type" => "dropdown", "heading" => __("Section Type", THEME_LANG), "param_name" => "section_type", "admin_label" => true, 'std' => 'best-seller', 'value' => array(__('Best Sellers', THEME_LANG) => 'best-seller', __('Most Reviews', THEME_LANG) => 'most-review', __('New Arrivals', THEME_LANG) => 'new-arrival', __('On Sales', THEME_LANG) => 'on-sales', __('Category', THEME_LANG) => 'category', __('Custom', THEME_LANG) => 'custom')), array("type" => "kt_categories", "heading" => __("Choose Category", THEME_LANG), "param_name" => "section_cate", "admin_label" => false, "dependency" => array("element" => "section_type", "value" => array('category'))), array("type" => "dropdown", "heading" => __("Order by", THEME_LANG), "param_name" => "orderby", "value" => array(__('None', THEME_LANG) => 'none', __('ID', THEME_LANG) => 'ID', __('Author', THEME_LANG) => 'author', __('Name', THEME_LANG) => 'name', __('Date', THEME_LANG) => 'date', __('Modified', THEME_LANG) => 'modified', __('Rand', THEME_LANG) => 'rand', __('Sale Price', THEME_LANG) => '_sale_price'), 'std' => 'date', "description" => __("Select how to sort retrieved posts.", THEME_LANG), "dependency" => array("element" => "section_type", "value" => array('custom', 'on-sales', 'category'))), array("type" => "dropdown", "heading" => __("Order", THEME_LANG), "param_name" => "order", "value" => array(__('ASC', THEME_LANG) => 'ASC', __('DESC', THEME_LANG) => 'DESC'), 'std' => 'DESC', "description" => __("Designates the ascending or descending order.", THEME_LANG), "dependency" => array("element" => "section_type", "value" => array('custom', 'on-sales', 'category'))), array("type" => "textfield", "heading" => __("Extra class name", "js_composer"), "param_name" => "el_class", "description" => __("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "js_composer"), 'admin_label' => false)))); class WPBakeryShortCode_Categories_Tab extends WPBakeryShortCodesContainer { protected function content($atts, $content = null) { $atts = function_exists('vc_map_get_attributes') ? vc_map_get_attributes('categories_tab', $atts) : $atts; extract(shortcode_atts(array('title' => 'Tabs Name', 'tabs_type' => 'tab-1', 'per_page' => 10, 'column' => 4, 'category' => 0, 'main_color' => '#ff3366', 'icon' => '', 'banner_top' => '', 'banner_left' => '', "featured" => false, 'autoplay' => 'false', 'navigation' => 'false', 'margin' => 0, 'slidespeed' => 250, 'css' => '', 'css_animation' => '', 'el_class' => '', 'nav' => 'true', 'loop' => 'true', 'use_responsive' => 0, 'items_destop' => 4, 'items_tablet' => 2, 'items_mobile' => 1), $atts)); global $woocommerce_loop; $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'container ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => $this->getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' ')); $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); if (function_exists('kt_hex2rgb')) { $main_color_rgb = kt_hex2rgb($main_color); } else { $main_color_rgb = array('red' => 255, 'green' => 51, 'blue' => 102); } $elementClass = apply_filters('kt_category_tab_class_container', $elementClass); $tabs = kt_get_all_attributes('tab_section', $content); $id = uniqid($category); $term = get_term($category, 'product_cat'); if (count($tabs) > 0 && $term) { $term_link = get_term_link($term);
function kt_cart_button() { if (kt_is_wc()) { ob_start(); $cart_count = WC()->cart->cart_contents_count; $cart_total = WC()->cart->get_cart_total(); $check_out_url = WC()->cart->get_cart_url(); $cart_content = WC()->cart->cart_contents; global $kt_used_header; ?> <?php if ($kt_used_header == 6) { ?> <div class="btn-cart" id="cart-block"> <a href="<?php echo $check_out_url; ?> " title="<?php _e('My cart', THEME_LANG); ?> " ><?php _e('Cart', THEME_LANG); ?> </a> <span class="notify notify-right"><?php echo $cart_count; ?> </span> <?php echo kt_get_cart_content($cart_content, $cart_total, $check_out_url); ?> </div> <?php } else { ?> <div id="cart-block" class="shopping-cart-box col-xs-5 col-sm-2"> <a class="cart-link" href="<?php echo $check_out_url; ?> "> <span class="title"><?php _e('Shopping cart', THEME_LANG); ?> </span> <span class="total"><?php echo sprintf(_n('%d item', '%d items', $cart_count), $cart_count); ?> <?php _e('-', THEME_LANG); ?> <?php echo $cart_total; ?> </span> <span class="notify notify-left"><?php echo $cart_count; ?> </span> </a> <?php echo kt_get_cart_content($cart_content, $cart_total, $check_out_url); ?> </div> <?php } ?> <?php } $result = ob_get_contents(); ob_clean(); return $result; }
function kt_search_form() { global $kt_used_header; if (isset($kt_used_header) && $kt_used_header) { $setting = kt_option('kt_used_header', '1'); $kt_used_header = intval($setting); } if (kt_is_wc() && $kt_used_header != 5) { get_template_part('templates/search-form/product', 'search-form'); } else { get_template_part('templates/search-form/post', 'search-form'); } }
/** * Get page tagline * * @return mixed|void */ function kt_get_page_subtitle() { global $post; $tagline = ''; if (is_front_page() && !is_singular('page')) { $tagline = esc_html__('Lastest posts', 'wingman'); } elseif (is_home()) { $page_for_posts = get_option('page_for_posts', true); $tagline = nl2br(rwmb_meta('_kt_page_header_subtitle', array(), $page_for_posts)); } elseif (is_front_page() && is_singular('page')) { $tagline = rwmb_meta('_kt_page_header_subtitle'); } elseif (is_archive()) { $tagline = get_the_archive_description(); if (kt_is_wc()) { if (is_shop()) { $shop_page_id = get_option('woocommerce_shop_page_id'); $tagline = rwmb_meta('_kt_page_header_subtitle', array(), $shop_page_id); } if (is_product_category() || is_product_tag()) { $tagline = ''; } } } elseif (is_search()) { $tagline = ''; } elseif ($post) { $post_id = $post->ID; $tagline = nl2br(rwmb_meta('_kt_page_header_subtitle', array(), $post_id)); } return apply_filters('kt_subtitle', $tagline); }
function kt_myaccount_menu_link($items, $args) { $kt_enable_myaccount_box = kt_option('kt_enable_myaccount_box', 'enable'); if ($kt_enable_myaccount_box == 'disable') { return $items; } ob_start(); if ($args->theme_location == 'topbar_menuright') { ?> <?php if (kt_is_wc()) { ?> <?php $myaccount_page_id = get_option('woocommerce_myaccount_page_id'); $myaccount_link = get_permalink(get_option('woocommerce_myaccount_page_id')); ?> <?php if (is_user_logged_in()) { ?> <?php if ($myaccount_page_id) { $logout_url = wp_logout_url(get_permalink(woocommerce_get_page_id('shop'))); if (get_option('woocommerce_force_ssl_checkout') == 'yes') { $logout_url = str_replace('http:', 'https:', $logout_url); } } ?> <li class="menu-item menu-item-has-children"> <a href="<?php echo esc_url($myaccount_link); ?> "><?php _e('My Account', 'kutetheme'); ?> </a> <ul class="sub-menu"> <?php if (function_exists('YITH_WCWL')) { $wishlist_url = YITH_WCWL()->get_wishlist_url(); ?> <li><a href="<?php echo esc_attr($wishlist_url); ?> "><?php _e('Wishlists', 'kutetheme'); ?> </a></li> <?php } ?> <?php if (defined('YITH_WOOCOMPARE')) { global $yith_woocompare; $count = count($yith_woocompare->obj->products_list); ?> <li><a href="#" class="yith-woocompare-open"><?php esc_html_e("Compare", 'kutetheme'); ?> <span>(<?php echo esc_attr($count); ?> )</span></a></li> <?php } ?> <?php if (isset($logout_url) && $logout_url) { ?> <li><a href="<?php echo esc_url($logout_url); ?> "><?php _e('Logout', 'kutetheme'); ?> </a></li> <?php } ?> </ul> </li> <?php } else { ?> <li class="menu-item login-item"><a href="<?php echo esc_url($myaccount_link); ?> "><?php _e('Login/Register', 'kutetheme'); ?> </a></li> <?php } ?> <?php } ?> <?php } $item = ob_get_contents(); $items = $item . $items; ob_clean(); return $items; }
/** * category dropdown * */ function vc_kt_categories_settings_field($settings, $value) { $args = array('id' => $settings['param_name'], 'name' => $settings['param_name'], 'class' => 'select-category wpb_vc_param_value', 'hide_empty' => 1, 'orderby' => 'name', 'order' => "desc", 'tab_index' => true, 'hierarchical' => true, 'echo' => 0, 'selected' => $value); if (kt_is_wc()) { $args['taxonomy'] = 'product_cat'; } return wp_dropdown_categories($args); }
<?php echo kt_menu_my_account(); ?> </div> </div> <!--/.top-header --> <!-- MAIN HEADER --> <div class="container main-header"> <div class="row"> <div class="col-xs-12 col-sm-3 logo"> <?php echo kt_get_logo(); ?> </div> <div class="header-search-box <?php echo kt_is_wc() ? 'col-xs-7 col-sm-7' : 'col-xs-12'; ?> "> <?php kt_search_form(); ?> </div> <?php echo kt_cart_button(); ?> </div> </div> <!-- END MANIN HEADER --> <div id="nav-top-menu" class="nav-top-menu"> <div class="container">
<i class="icon_lock_alt"></i> <?php esc_html_e('My Account', 'wingman'); ?> </a> </li> <?php } ?> <?php kt_custom_wpml('<li class="language-switcher">', '</li>', esc_html__('Language', 'wingman')); ?> <?php if (class_exists('WOOCS') && kt_is_wc()) { ?> <li class="currency-switcher"> <a href="#"><i class="icon_currency"></i><?php esc_html_e('Currency', 'wingman'); ?> </a> <?php global $WOOCS; $currencies = $WOOCS->get_currencies(); //print_r($currencies); echo '<ul class="currency-switcher-content">'; foreach ($currencies as $key => $currency) { $selected = $WOOCS->current_currency == $key ? 'active' : ''; printf('<li class="%s"><a href="#" data-currency="%s" title="%s"><span></span>%s</a>', $selected, esc_attr($currency['name']), esc_attr($currency['description']), $currency['name']); }
<?php echo kt_menu_my_account(); ?> </div> </div> <!--/.top-header --> <!-- MAIN HEADER --> <div class="container main-header"> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-3 logo"> <?php echo kt_get_logo(); ?> </div> <div class="header-search-box <?php echo kt_is_wc() ? 'col-xs-7 col-sm-8 col-md-7' : 'col-xs-12 col-md-9'; ?> "> <?php kt_search_form(); ?> <div class="keyword"> <p class="lebal">Keywords:</p> <p> <a href="#">T-shirt, </a> <a href="#">Leggings, </a> <a href="#">Cotton, ...</a> </p> </div> </div> <div class="col-xs-5 col-sm-3 col-md-2 group-button-header">
/** * Woocommerce cart in header * * @since 1.0 */ function kt_woocommerce_get_cart() { if (kt_is_wc()) { kt_cart_link(); if (!is_cart()) { ?> <div class="shopping-bag-content woocommerce widget_shopping_cart"> <?php the_widget('WC_Widget_Cart', 'title='); ?> </div><!-- .shopping-bag-content --> <?php } } }