'shop',
'hover_image' => 'show',
'attachment_ids' => array(),
'layout' => 'masonry',
'columns' => '1',
'gutter' => '',
'nav_style' => '',
'carousel' => 'disable',
'carousel_class' => '',
'autoplay' => '',
'template' => 'buttons-on-hover',
'border' => 'enable',
'image_size' => 'shop_catalog',
'image_size_width' => '',
'image_size_height' => '',
'image_size_crop' => '',
'catalog_mode' => false,
'ajax_add_to_cart' => 'yes',
'quickview' => 'enable',
'compare' => 'enable',
'wishlist' => 'enable',
'hover_price' => 'enable',
'entrance_animation' => 'fadein',
'responsive_animation' => 'disable',
'animation' => 'none',
'delay' => '0',
'list_style' => 'light',
'badges' => 'enable',
'hover_color' => 'c0392b',
'custom_hover_color' => '',
'countdown_activation' => '',
'progressbar_activation' => '',
'product_color_scheme' => 'light',
'column_in_mobile' => '1',
'classes' => ''
);
extract( $defaults );
// Extra post classes
$classes = array();
$attachment_ids = $product->get_gallery_image_ids();
if ( count( $attachment_ids ) > 0 ) {
$classes[] = 'has-gallery';
}
if ( isset( $_GET['productBorder'] ) && ( sanitize_text_field( $_GET['productBorder'] ) == 'with-border' || sanitize_text_field( $_GET['productBorder'] ) == 'no-border' ) ) {
if ( sanitize_text_field( $_GET['productBorder'] ) == 'with-border' ) {
$product_border = 1;
} else {
$product_border = 0;
}
} else {
$product_border = kite_opt( 'shop-product-border', true );
}
$products_view = kite_opt( 'shop-product-view', 'grid' );
if ( $products_view === 'grid_sv' || $products_view === 'list_sv' ) {
if ( isset( $_GET['view'] ) ) {
$products_view = sanitize_text_field( $_GET['view'] );
}
}
if ( $product_border != 0 ) {
$classes[] = 'with-border';
}
$columns = kite_opt( 'shop-column', 4 );
$catalog_mode = isset( $_GET['catalog-mode'] ) ? true : kite_opt( 'catalog_mode', false );
$product_style = kite_opt( 'shop-product-style', KITE_DEFAULT_PRODUCT_STYLE );
$ajax_add_to_cart = get_option( 'woocommerce_enable_ajax_add_to_cart' );
$quickview = kite_opt( 'shop-enable-quickview', false );
$wishlist = ( class_exists( 'YITH_WCWL' ) ) ? true : false;
$compare = ( class_exists( 'YITH_Woocompare' ) && get_option( 'yith_woocompare_compare_button_in_products_list' ) == 'yes' ) ? true : false;
$hover_image = ( kite_opt( 'product-hover-image', true ) == 1 ) ? 'show' : '';
$layout = kite_opt( 'shop-layout', 'fitRows' );
$hover_color = kite_opt( 'product-hover-color', 'c0392b' );
$custom_hover_color = kite_opt( 'product-hover-custom-color', '#fff' );
$classes[] = ( ! kite_opt( 'shop-product-color-scheme', true ) ) ? 'dark' : '';
if ( isset( $_GET['shopWidth'] ) && ! empty( $_GET['shopWidth'] ) ) {
if ( sanitize_text_field( $_GET['shopWidth'] ) == 'fullwidth' ) {
$fullwidth = true;
} elseif ( sanitize_text_field( $_GET['shopWidth'] ) == 'container' ) {
$fullwidth = false;
} else {
$fullwidth = kite_opt( 'shop-enable-fullwidth', false );
}
} else {
$fullwidth = kite_opt( 'shop-enable-fullwidth', false );
}
$container = ( $fullwidth !== 1 );
if ( isset( $_GET['shopSidebar'] ) && ! empty( $_GET['shopSidebar'] ) ) {
if ( sanitize_text_field( $_GET['shopSidebar'] ) == 'left' ) {
$sidebarPos = '1';
} elseif ( sanitize_text_field( $_GET['shopSidebar'] ) == 'right' ) {
$sidebarPos = '2';
} elseif ( sanitize_text_field( $_GET['shopSidebar'] ) == 'no-sidebar' ) {
$sidebarPos = '0';
} else {
$sidebarPos = kite_opt( 'shop-sidebar-position', '0' );
}
} else {
$sidebarPos = kite_opt( 'shop-sidebar-position', '0' );
}
$shop_sidebar = ( $sidebarPos != 0 );
$product_template = kite_opt( 'shop-product-style', KITE_DEFAULT_PRODUCT_STYLE );
$responsive_list_view = ( $products_view == 'list' && kite_opt( 'responsive-product-list-view', false ) ) ? true : false;
switch ( $product_template ) {
case 'buttonsonhover':
$product_template = 'buttons-on-hover';
break;
case 'centered':
$product_template = 'buttons-on-hover';
break;
case 'infoonhover':
$product_template = 'info-on-hover';
break;
default:
break;
}
if ( empty( $cart_button_style ) ) {
$cart_button_style = ( ( $on_hover_style = kite_opt( 'modern-button-on-hover-style', 'horizontal' ) ) == 'vertical' ) && ( ( $cart_button_style = kite_opt( 'modern-button-on-hover-cart-style', 'default') ) == 'quantity' || $cart_button_style == 'stretched' ) ? $cart_button_style : '';
if ( $product_template == 'modern-buttons-on-hover' && $on_hover_style == 'vertical' ) {
$classes[] = 'vertical-buttons';
}
if ( $product_template == 'modern-buttons-on-hover' && $on_hover_style == 'vertical' && ! empty( $cart_button_style ) ) {
$classes[] = 'separated-cart';
}
}
$product_rating = kite_opt( 'shop-product-rating', false );
if ( $product_rating !== 0 ) {
add_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_rating', 3 );
}
include locate_template( 'templates/woocommerce/product-' . $product_template . '.php', false, false );
}
add_action( 'kite_woocommerce_shop_loop_item', 'kite_shop_item' );
function kite_render_product_buttons( $product, $quickview, $wishlist, $compare, $ajax_add_to_cart, $catalog_mode ) {
include locate_template( 'templates/woocommerce/product-buttons.php', false, false );
}
add_action( 'kite_woocommerce_widget_loop_buttons', 'kite_render_product_buttons', 1, 6);
add_action( 'kite_woocommerce_shop_loop_buttons', 'kite_render_product_buttons', 1, 6);
/* -------------------------------------------------------------------------- */
/* WooCommerce columns */
/* -------------------------------------------------------------------------- */
if ( ! function_exists( 'kite_custom_loop_columns' ) ) {
function kite_custom_loop_columns() {
return kite_opt( 'shop-column', 4 );
}
}
add_filter( 'loop_shop_columns', 'kite_custom_loop_columns' );
/* -------------------------------------------------------------------------- */
/* WooCommerce search redirect to product detail */
/* when there is just 1 product */
/* -------------------------------------------------------------------------- */
add_filter( 'woocommerce_redirect_single_search_result', '__return_false' );
/* -------------------------------------------------------------------------- */
/* Get account/login link */
/* -------------------------------------------------------------------------- */
if ( ! function_exists( 'kite_get_myaccount_link' ) ) {
function kite_get_myaccount_link( $text = true ) {
$myaccount_url = get_permalink( get_option( 'woocommerce_myaccount_page_id' ) );
$link_title = ( is_user_logged_in() ) ? esc_html__( 'My Account', 'teta-lite' ) : esc_html__( 'Login', 'teta-lite' );
$link_class = ( is_user_logged_in() ) ? '' : ' class="login-link-popup no_djax"';
if ( $text ) {
return '' . $link_title . ' ';
} else {
return ' ';
}
}
}
/* -------------------------------------------------------------------------- */
/* Redeclare Original WC functions - cart & checkout buttons in cart */
/* -------------------------------------------------------------------------- */
if ( ! function_exists( 'woocommerce_widget_shopping_cart_button_view_cart' ) ) {
function woocommerce_widget_shopping_cart_button_view_cart() {
// add data-hover attribute for checkout and view cart buttons
echo '
' . esc_html__( 'View Cart', 'teta-lite' ) . '
';
}
}
if ( ! function_exists( 'woocommerce_widget_shopping_cart_proceed_to_checkout' ) ) {
function woocommerce_widget_shopping_cart_proceed_to_checkout() {
echo '
' . esc_html__( 'Checkout', 'teta-lite' ) . '
';
}
}
/* -------------------------------------------------------------------------- */
/* Product review */
/* -------------------------------------------------------------------------- */
if ( ! function_exists( 'kite_product_review' ) ) {
function kite_product_review( $comment ) {
$verified = wc_review_is_from_verified_owner( $comment->comment_ID );
if ( '0' === $comment->comment_approved ) {
?>
(' . esc_html__( 'verified owner', 'teta-lite' ) . ') ';
}
if ( get_option( 'woocommerce_review_rating_verification_label' ) === 'yes' ) {
if ( wc_customer_bought_product( $comment->comment_author_email, $comment->user_id, $comment->comment_post_ID ) ) {
echo '(' . esc_html__( 'verified owner', 'teta-lite' ) . ') ';
}
}
?>
$parentid,
'hide_empty' => false,
);
$terms = get_terms( 'product_cat', $args );
if ( $terms ) {
foreach ( $terms as $term ) {
if ( $term->count > 0 ) { // prevent to display empty categories
$cat_icon = get_term_meta( $term->term_id, 'cat_icon', true );
if ( empty( $cat_icon ) ) {
echo '' . $term->name . ' (' . $term->count . ') ';
} else {
echo '
' . ' ';
}
}
}
}
}
}
/* -------------------------------------------------------------------------- */
/* Extend Woocommerce product */
/* -------------------------------------------------------------------------- */
if ( ! function_exists( 'kite_woocommerce_product_extended' ) ) {
function kite_woocommerce_product_extended() {
$taxonomy = 'product_cat';
$orderby = 'name';
$show_count = 0;
$pad_counts = 0;
$hierarchical = 1;
$title = '';
$empty = 1;
$args = array(
'taxonomy' => $taxonomy,
'orderby' => $orderby,
'show_count' => $show_count,
'pad_counts' => $pad_counts,
'hierarchical' => $hierarchical,
'title_li' => $title,
'hide_empty' => $empty,
);
$all_categories = get_categories( $args );
foreach ( $all_categories as $cat ) {
if ( $cat->category_parent == 0 ) {
$category_id = $cat->term_id;
$cat_icon = get_term_meta( $category_id, 'cat_icon', true );
echo '
' . $cat->name . ' ';
$args2 = array(
'taxonomy' => $taxonomy,
'parent' => $category_id,
'orderby' => $orderby,
'show_count' => $show_count,
'pad_counts' => $pad_counts,
'hierarchical' => $hierarchical,
'title_li' => $title,
'hide_empty' => $empty,
);
$sub_cats = get_categories( $args2 );
if ( $sub_cats ) {
echo '
';
}
}
//echo ' ';
}
}
}
/* -------------------------------------------------------------------------- */
/* mobile category menu */
/* -------------------------------------------------------------------------- */
if ( ! function_exists( 'kite_woocommerce_cat_menu' ) ) {
function kite_woocommerce_cat_menu() {
global $wp_query, $post;
$taxonomy = 'product_cat';
$orderby = 'name';
$show_count = 0;
$pad_counts = 0;
$hierarchical = 1;
$title = '';
$empty = 1;
$max_depth = 3;
$args = array(
'taxonomy' => $taxonomy,
'orderby' => $orderby,
'show_count' => $show_count,
'pad_counts' => $pad_counts,
'hierarchical' => $hierarchical,
'title_li' => $title,
'hide_empty' => $empty,
);
$args['depth'] = $max_depth;
$current_cat = false;
$cat_ancestors = array();
if ( is_tax( 'product_cat' ) ) {
$current_cat = $wp_query->queried_object;
$cat_ancestors = get_ancestors( $current_cat->term_id, 'product_cat' );
}
elseif ( is_singular( 'product' ) ) {
$terms = wc_get_product_terms(
$post->ID,
'product_cat',
apply_filters(
'woocommerce_product_categories_widget_product_terms_args',
array(
'orderby' => 'parent',
'order' => 'DESC',
)
)
);
if ( $terms ) {
$main_term = apply_filters( 'woocommerce_product_categories_widget_main_term', $terms[0], $terms );
$current_cat = $main_term;
$cat_ancestors = get_ancestors( $main_term->term_id, 'product_cat' );
}
}
$args['current_category'] = ( $current_cat ) ? $current_cat->term_id : '';
$args['current_category_ancestors'] = $cat_ancestors;
wp_list_categories( apply_filters( 'woocommerce_product_categories_widget_args', $args ) );
}
}
add_action( 'woocommerce_before_shop_loop', 'kite_woocommerce_productCategory_menu', 4 );
if ( ! function_exists( 'kite_woocommerce_productCategory_menu' ) ) {
function kite_woocommerce_productCategory_menu() {
?>
woocommerce_product_loop_start( false ),
'after' => woocommerce_product_loop_end( false ),
)
) ) :
do_action( 'woocommerce_before_shop_loop' );
wc_get_template( 'loop/no-products-found.php' );
do_action( 'woocommerce_after_shop_loop' );
endif;
/**
* Hook: woocommerce_after_main_content.
*
* @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
*/
do_action( 'woocommerce_after_main_content' );
}
}
}
/* -------------------------------------------------------------------------- */
/* Redeclare original woocommerce_get_product_thumbnail */
/* -------------------------------------------------------------------------- */
if ( ! function_exists( 'woocommerce_get_product_thumbnail' ) ) {
function woocommerce_get_product_thumbnail( $size = 'shop_catalog', $placeholder_width = 0, $placeholder_height = 0 ) {
global $post;
$image_size = apply_filters( 'single_product_archive_thumbnail_size', $size );
$lazy_load = kite_opt( 'is_lazy_load_enable', true );
if ( ( ! is_array( $image_size ) && has_image_size( $image_size ) ) || ! has_post_thumbnail() || $image_size == 'full' ) {
$post_thumbnail_ID = has_post_thumbnail() ? get_post_thumbnail_id() : get_option( 'woocommerce_placeholder_image', 0 );
$props = wc_get_product_attachment_props( $post_thumbnail_ID, $post );
$img = wp_get_attachment_image(
$post_thumbnail_ID,
$image_size,
false,
array(
'title' => $props['title'],
'alt' => $props['alt'],
)
);
if ( $lazy_load ) {
$img = str_replace( 'src=', 'src="data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D\'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg\'%20viewBox%3D\'0%200%20200%20150\'%2F%3E" data-src=', $img );
}
} else {
if ( is_array( $image_size ) && isset( $image_size['width'] ) && isset( $image_size['height'] ) && isset( $image_size['crop'] ) ) {
$image_dimension = $image_size;
} elseif ( function_exists( 'wc_get_image_size' ) ) {
$image_dimension = wc_get_image_size( $image_size );
} else {
$img = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', $image_size ) );
return '' . $img . '
';
}
$image_title = get_the_title( get_post_thumbnail_id() );
$image_link = wp_get_attachment_url( get_post_thumbnail_id() );
if ( function_exists( 'aq_resize' ) ) {
$image_attributes = aq_resize( $image_link, $image_dimension['width'], $image_dimension['height'], $image_dimension['crop'], false, true );
}
$img_url = isset( $image_attributes[0] ) ? $image_attributes[0] : $image_link;
$img_width = isset( $image_attributes[1] ) ? $image_attributes[1] : $image_size['width'];
$img_height = isset( $image_attributes[2] ) ? $image_attributes[2] : $image_size['height'];
$image_src_attrib = $lazy_load ? 'src="data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D\'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg\'%20viewBox%3D\'0%200%20' . $img_width . '%20' . $img_height . '\'%2F%3E" data-src="' . esc_url( $img_url ) . '"' : 'src="' . esc_url( $img_url ) . '"';
$img = ' ';
}
$lazy_load_class = $lazy_load ? 'lazy-load lazy-load-on-load' : 'kt-disable-lazy-load';
return '' . $img . '
';
}
}
/* -------------------------------------------------------------------------- */
/* Set appropriate image size for product thumbnails in masonry shop */
/* -------------------------------------------------------------------------- */
if ( ! function_exists( 'kite_product_thumbnail_masonry_size' ) ) {
function kite_product_thumbnail_masonry_size( $size ) {
return kite_opt( 'shop-layout', 'fitRows' ) == 'masonry' ? 'Kite_product_thumbnail-auto-height' : $size;
}
}
add_filter( 'single_product_archive_thumbnail_size', 'kite_product_thumbnail_masonry_size' );
if ( ! function_exists( 'kite_woo_hide_page_title' ) ) {
function kite_woo_hide_page_title() {
return false;
}
}
add_filter( 'woocommerce_show_page_title', 'kite_woo_hide_page_title' );
// Ensure cart contents update when products are added to the cart via AJAX
if ( ! function_exists( 'kite_woocommerce_header_add_to_cart_fragment' ) ) {
function kite_woocommerce_header_add_to_cart_fragment( $fragments ) {
ob_start();
?>
cart->cart_contents_count; ?>
$quantity ), true );
}
}
}
add_action( 'woocommerce_ajax_added_to_cart', 'kite_woocommerce_addtocart_add_notices' );
// Print notices in reponse of adding item to cart ( cart widget) to access it through ajax add-to-cart
if ( ! function_exists( 'kite_woocommerce_addtocart_print_notices' ) ) {
function kite_woocommerce_addtocart_print_notices() {
if ( kite_is_shop_ajax_add_to_cart() ) {
if ( kite_opt( 'woocommerce-notices', true ) != '0' ) {
wc_print_notices(); // print notices to be shown in popup style
} else {
wc_clear_notices();// clear notices silently
}
}
}
}
if ( ! function_exists( 'kite_woocommerce_addtocart_print_notices_action' ) ) {
function kite_woocommerce_addtocart_print_notices_action() {
add_action( 'woocommerce_after_mini_cart', 'kite_woocommerce_addtocart_print_notices' );
// print notices in loop products shortcodes
if ( ! function_exists( 'wc_print_notices' ) ) {
return;
}
add_action( 'woocommerce_shortcode_before_single_product_loop', 'wc_print_notices', 10 );
add_action( 'woocommerce_shortcode_before_products_loop', 'wc_print_notices', 10 );
add_action( 'woocommerce_shortcode_before_sale_products_loop', 'wc_print_notices', 10 );
add_action( 'woocommerce_shortcode_before_best_selling_products_loop', 'wc_print_notices', 10 );
add_action( 'woocommerce_shortcode_before_top_rated_products_loop', 'wc_print_notices', 10 );
add_action( 'woocommerce_shortcode_before_featured_products_loop', 'wc_print_notices', 10 );
add_action( 'woocommerce_shortcode_before_product_attribute_loop', 'wc_print_notices', 10 );
add_action( 'woocommerce_shortcode_before_recent_products_loop', 'wc_print_notices', 10 );
}
}
kite_woocommerce_addtocart_print_notices_action();
// remove archive desciption
remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
if ( ! function_exists( 'kite_remove_ptags_around_shop_page_content' ) ) {
function kite_remove_ptags_around_shop_page_content( $content ) {
if ( strpos( $content, '' ) !== false ) {
return preg_replace( '/(.+)<\/p>$/Uuis', '$1', $content );
}
return $content;
}
}
add_filter( 'woocommerce_format_content', 'kite_remove_ptags_around_shop_page_content' );
/* -------------------------------------------------------------------------- */
/* Product Filter and Porduct Order */
/* -------------------------------------------------------------------------- */
if ( ! function_exists( 'kite_woocommerce_shop_filter_action' ) ) {
function kite_woocommerce_shop_filter_action() {
if ( isset( $_GET['shopFilter'] ) && ! empty( $_GET['shopFilter'] ) ) {
if ( esc_html( $_GET['shopFilter'] ) == 'width-filter' ) {
$shopFilter = true;
} elseif ( esc_html( $_GET['shopFilter'] ) == 'without-filter' ) {
$shopFilter = false;
} else {
$shopFilter = kite_opt( 'shop-filter', false );
}
} else {
$shopFilter = kite_opt( 'shop-filter', false );
}
add_action( 'woocommerce_before_shop_loop', 'kite_woocommerce_filter', 4 );
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );
if ( $shopFilter != 1 ) {
if ( is_active_sidebar( 'woocommerce-sidebar' ) ) {
add_action( 'woocommerce_before_shop_loop', 'kite_woocommerce_sidebar', 40 );
}
}
}
}
add_action( 'init', 'kite_woocommerce_shop_filter_action' );
if ( ! function_exists( 'kite_woocommerce_container' ) ) {
function kite_woocommerce_container() {
if ( isset( $_GET['shopWidth'] ) && ! empty( $_GET['shopWidth'] ) ) {
if ( esc_html( $_GET['shopWidth'] ) == 'fullwidth' ) {
$fullwidth = true;
} elseif ( esc_html( $_GET['shopWidth'] ) == 'container' ) {
$fullwidth = false;
} else {
$fullwidth = kite_opt( 'shop-enable-fullwidth', false );
}
} else {
$fullwidth = kite_opt( 'shop-enable-fullwidth', false );
}
if ( isset( $_GET['shopSidebar'] ) && ! empty( $_GET['shopSidebar'] ) ) {
if ( esc_html( $_GET['shopSidebar'] ) == 'left' ) {
$sidebarPos = '1';
} elseif ( esc_html( $_GET['shopSidebar'] ) == 'right' ) {
$sidebarPos = '2';
} elseif ( esc_html( $_GET['shopSidebar'] ) == 'no-sidebar' ) {
$sidebarPos = '0';
} else {
$sidebarPos = kite_opt( 'shop-sidebar-position' , 0 );
}
} else {
$sidebarPos = kite_opt( 'shop-sidebar-position' , 0 );
}
if ( ! is_product() && ! ( function_exists( 'wcfm_is_store_page' ) && wcfm_is_store_page() ) ) {
if ( 0 == $sidebarPos || !kite_count_sidebar_widgets( 'woocommerce-sidebar' ) ) {
if ( $fullwidth != 1 ) {
echo '
';
} else {
echo '';
}
}
}
add_action( 'kite_woocommerce_before_account_navigation', 'kite_myaccount_customer_avatar' );
/*-----------------------------------------------------------------*/
// Login/rgister popup
/*-----------------------------------------------------------------*/
if ( ! function_exists( 'kite_load_account_page' ) ) {
function kite_load_account_page() {
if ( ( ! is_user_logged_in() ) && ( kite_woocommerce_installed() ) ) {
?>
is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '',
esc_attr( $product->get_type() ),
esc_attr( $product->get_type() == 'simple' && 'yes' === get_option( 'woocommerce_enable_ajax_add_to_cart' ) ? 'ajax_add_to_cart' : '' )
);
$link = str_replace( 'class="button"', $class, $link );
$link = str_replace( 'class="ajax_add_to_cart button"', $class, $link );
return '
' . $link . ' ';
}
}
/* Change structure of add-to-cart button in instant-shop product style */
if ( ! function_exists( 'kite_loop_instant_shop_add_to_cart_link' ) ) {
function kite_loop_instant_shop_add_to_cart_link( $link ) {
$newLink = str_replace( '
', '', $link );
// change classes of A tag
$newLink = str_replace( '
#';
preg_match( $pattern, $link, $result );
$text_span = $text = '';
if ( $result[0] ) {
$text_span = $result[0];
// Find the text
$pattern = '#class="txt" data-hover="(.*?)">#';
preg_match( $pattern, $text_span, $result );
if ( $result[1] ) {
$text = $result[1];
$link = str_replace(
$text_span,
'' . $text . '
' . $text . ' ',
$link
);
}
return $link;
} else {
return $link;
}
}
}
if ( ! function_exists( 'kite_social_share_action' ) ) {
function kite_social_share_action() {
// call social Share in product detail - Quick View
add_action( 'quick_view_product_summary', 'kite_social_share', 32 );
// social Share in product detail
if ( ! kite_opt( 'single_product_meta', true ) ) {
add_action( 'woocommerce_single_product_summary', 'kite_social_share', 36 ); // 35 belong compare actions
} else {
add_action( 'woocommerce_single_product_summary', 'kite_social_share', 50 ); // 35 belong compare actions
}
}
}
if ( class_exists( 'Kite_Core' ) ) {
add_action( 'init', 'kite_social_share_action' );
}
/*-----------------------------------------------------------------*/
// Show Count Down Timer for Deal Products in Single Page Content
/*-----------------------------------------------------------------*/
add_action( 'woocommerce_single_product_summary', 'add_deal_count_down_timer', 20 );
if ( ! function_exists( 'add_deal_count_down_timer' ) ) {
function add_deal_count_down_timer( $flag ) {
if ( ! function_exists( 'kite_sc_countdown' ) ) {
return;
}
global $post;
$today = time();
$deal_end_date = get_post_meta( get_the_ID(), '_sale_price_dates_to', true );
$deal_start_date = get_post_meta( get_the_ID(), '_sale_price_dates_from', true );
if ( !empty( $deal_start_date ) && $deal_start_date > $today ) {
return;
}
if ( ! empty( $deal_end_date ) && $deal_end_date > $today && ( $flag == 1 || empty( $flag ) ) ) {
$deal_end_date = date( 'Y-m-d', $deal_end_date );
echo '';
echo kite_sc_countdown(
array(
'end_date' => $deal_end_date,
'fontsize' => '28',
'color' => '#000000',
'label_color' => '#000000',
'alignment' => 'center',
)
);
echo '
';
}
if ( ! empty( $deal_end_date ) && $deal_end_date > $today && $flag == 2 ) {
return 'count_down';
}
}
}
/*-----------------------------------------------------------------*/
// product progress bar
/*-----------------------------------------------------------------*/
if ( ! function_exists( 'kite_stock_progress_bar_variation_action' ) ) {
function kite_stock_progress_bar_variation_action() {
global $product;
if ( $product->is_type( 'variable' ) ) {
add_action( 'woocommerce_single_product_summary', 'kite_stock_progress_bar' );
} else {
add_action( 'woocommerce_single_product_summary', 'kite_stock_progress_bar' , 20);
}
}
}
add_action( 'woocommerce_single_product_summary', 'kite_stock_progress_bar_variation_action' );
if ( ! function_exists( 'kite_stock_progress_bar' ) ) {
function kite_stock_progress_bar( $flag ) {
global $woocommerce, $product, $post;
$product_id = get_the_ID();
$current_stock = 0;
if ( $product->is_type( 'variable' ) ) {
$available_variations = $product->get_available_variations();
foreach ( $available_variations as $key => $variation ) {
$variation_id = $variation['variation_id'];
$variation_obj = new WC_Product_variation( $variation_id );
$stock = $variation_obj->get_stock_quantity();
$current_stock = $current_stock + $stock;
}
} else {
$current_stock = get_post_meta( $product_id, '_stock', true );
}
$total_stock = get_post_meta( $product_id, 'kt_total_stock_quantity', true );
if ( ! $total_stock ) {
return;
}
$total_sold = $total_stock > $current_stock ? $total_stock - $current_stock : 0;
$percentage = $total_sold > 0 ? round( $total_sold / $total_stock * 100 ) : 0;
if ( $current_stock > 0 && ( $flag == 1 || empty( $flag ) ) ) {
echo '';
echo '
';
echo '
' . esc_html__( 'SOLD: ' , 'teta-lite') . $total_sold . '/' . $total_stock . '
';
echo '
';
echo esc_html__( 'SOLD: ', 'teta-lite' ). $total_sold . '/' . $total_stock;
echo '
';
}
if ( $current_stock > 0 && $flag == 2 ) {
return 'Product_availability';
}
}
}
if ( ! function_exists( 'kite_total_stock_quantity_input' ) ) {
function kite_total_stock_quantity_input() { // phpcs:ignore
echo '';
woocommerce_wp_text_input(
array(
'id' => 'kt_total_stock_quantity',
'label' => esc_html__( 'Initial number in stock', 'teta-lite' ),
'wrapper_class' => 'Initial_stock',
'desc_tip' => 'true',
'description' => esc_html__( 'Required for stock progress bar option', 'teta-lite' ),
'type' => 'number',
)
);
echo '
';
}
add_action( 'woocommerce_product_options_inventory_product_data', 'kite_total_stock_quantity_input' );
}
if ( ! function_exists( 'kite_save_total_stock_quantity' ) ) {
function kite_save_total_stock_quantity( $post_id ) { // phpcs:ignore
$total_stock = isset( $_POST['kt_total_stock_quantity'] ) ? wc_clean( $_POST['kt_total_stock_quantity'] ) : ''; // phpcs:ignore
$product = wc_get_product( $post_id );
$product->update_meta_data( 'kt_total_stock_quantity', $total_stock );
$product->save();
}
add_action( 'woocommerce_process_product_meta', 'kite_save_total_stock_quantity' );
}
/* -------------------------------------------------------------------------- */
/* Search Products by sku */
/* -------------------------------------------------------------------------- */
function kite_get_products_by_sku() {
global $getProductsBySku;
$getProductsBySku = array();
if ( ! isset( $_GET['s'] ) || ( isset( $_POST['action'] ) && $_POST['action'] == 'kite_ajax_search_action' ) ) {
return;
}
$s = trim( sanitize_text_field( $_GET['s'] ) );
if ( ! isset( $_GET['cat'] ) ) {
$cat = '';
} else {
$cat = trim( sanitize_text_field( $_GET['cat'] ) );
}
$args_sku = array(
'post_type' => 'product',
'posts_per_page' => 20,
'product_cat' => $cat,
'meta_query' => array(
array(
'key' => '_sku',
'value' => $s,
'compare' => 'like',
),
),
'suppress_filters' => false,
);
$getProductsBySku = get_posts( $args_sku );
}
// add_action( 'init', 'kite_get_products_by_sku' );
// merge search by sku result with search result and filtering same results
// add_filter( 'the_posts', 'kite_generate_search_posts' );
function kite_generate_search_posts( $posts, $query = false ) {
if ( ! isset( $_GET['s'] ) || ( isset( $_POST['action'] ) && $_POST['action'] == 'kite_ajax_search_action' ) ) {
return $posts;
}
global $getProductsBySku;
if ( ! isset( $getProductsBySku ) ) {
$getProductsBySku = array();
}
$allSearchResults = array_merge( $getProductsBySku, $posts );
$productsID = array();
foreach ( $allSearchResults as $key => $product ) {
$id = $product->ID;
if ( in_array( $id, $productsID ) ) {
unset( $allSearchResults[ $key ] );
} else {
$productsID[] = $id;
}
}
return $allSearchResults;
}
/*-----------------------------------------------------------------*/
// Category Description Position
/*-----------------------------------------------------------------*/
if ( ! function_exists( 'kite_wc_category_description_position' ) ) {
function kite_wc_category_description_position() {
$allowed_html = [
'a' => [
'href' => [],
'title' => [],
],
'br' => [],
'h1' => [],
'p' => [],
'em' => [],
'strong' => [],
];
$subTitle = term_description();
if ( kite_opt( 'category-description-position', true ) == '0' ) {
kite_wc_category_description_position_action();
} else {
?>
';
},
10
);
add_action( 'woocommerce_before_shop_loop', 'woocommerce_taxonomy_archive_description', 10 );
add_action( 'woocommerce_before_shop_loop', 'woocommerce_taxonomy_archive_description', 10 );
add_action(
'woocommerce_before_shop_loop',
function () {
echo ' ';
},
10
);
}
}
/*-----------------------------------------------------------------*/
// Show Product Variations
/*-----------------------------------------------------------------*/
if ( ! function_exists( 'show_product_variations' ) ) {
function show_product_variations( $show_all_variations = true, $image_size = 'woocommerce_thumbnail' ) {
global $product;
$tax_display_mode = get_option( 'woocommerce_tax_display_shop' );
$product_id = $product->get_id();
$product_sku = $product->get_sku();
if ( $product->is_type( 'variable' ) ) {
$available_variations = $product->get_available_variations();
$product_variation = new WC_Product_Variable( $product_id );
$attributes = $product_variation->get_variation_attributes();
if ( ! ( sizeof( $attributes ) > 1 ) ) {
$taxonomy_types = array();
$attribute_taxonomies = wc_get_attribute_taxonomies();
if ( $attribute_taxonomies ) {
foreach ( $attribute_taxonomies as $tax ) {
$taxonomy_types[ wc_attribute_taxonomy_name( $tax->attribute_name ) ] = $tax->attribute_type;
}
}
$proccessed_variation = 0;
foreach ( $attributes as $attribute => $value ) {
if ( ! taxonomy_exists( $attribute ) ) {
continue;
}
$variation_regular_price = array();
$variation_sale_price = array();
$variation_image = array();
$variation_srcset = array();
$data_variation_id = array();
$variation_sku = array();
$variation_add_to_cart_url = array();
for ( $i = 0; $i < count( $available_variations ); $i++ ) {
$variation_id = $available_variations[ $i ]['variation_id'];
$variation_prd = new WC_Product_Variation( $variation_id );
if ( ! $variation_prd->is_in_stock() || ! $variation_prd->is_purchasable() ) {
continue;
}
if ( ! empty( $variation_prd->get_regular_price() ) ) {
$variation_regular_price[ $available_variations[ $i ]['attributes'][ 'attribute_' . $attribute ] ] = 'incl' === $tax_display_mode ? wc_get_price_including_tax( $variation_prd ) : wc_get_price_excluding_tax( $variation_prd );
}
if ( ! empty( $variation_prd->get_sale_price() && empty( $tax_display_mode ) ) ) {
$variation_sale_price[ $available_variations[ $i ]['attributes'][ 'attribute_' . $attribute ] ] = $variation_prd->get_sale_price();
}
$data_variation_id[ $available_variations[ $i ]['attributes'][ 'attribute_' . $attribute ] ] = $variation_id;
if ( $image_size == 'full' ) {
$image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' )[0];
} else {
if ( function_exists( 'wc_get_image_size' ) ) {
$image_dimension = wc_get_image_size( $image_size );
$image_link = wp_get_attachment_url( $available_variations[ $i ]['image_id'] );
if ( function_exists( 'aq_resize' ) ) {
$image_attributes = aq_resize( $image_link, $image_dimension['width'], $image_dimension['height'], $image_dimension['crop'], false, true );
}
$image_url = isset( $image_attributes[0] ) ? $image_attributes[0] : $image_link;
} else {
$image_url = wp_get_attachment_image_src( $available_variations[ $i ]['image_id'], 'woocommerce_thumbnail' )[0];
}
}
$variation_image[ $available_variations[ $i ]['attributes'][ 'attribute_' . $attribute ] ] = $image_url;
$variation_srcset[ $available_variations[ $i ]['attributes'][ 'attribute_' . $attribute ] ] = ''; // wp_get_attachment_image_srcset( $available_variations[ $i ]['image_id'], 'woocommerce_thumbnail', null );
$variation_add_to_cart_url[ $available_variations[ $i ]['attributes'][ 'attribute_' . $attribute ] ] = $variation_prd->add_to_cart_url();
$variation_sku[ $available_variations[ $i ]['attributes'][ 'attribute_' . $attribute ] ] = $variation_prd->get_sku();
$sale_price = '';
}
if ( empty( $data_variation_id ) ) {
return;
}
echo "";
$terms = wp_get_post_terms( $product_id, $attribute );
echo '
';
$term_names = array();
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
foreach ( $terms as $term ) {
// show only 3 variations
if ( ! $show_all_variations ) {
if ( $proccessed_variation >= 3 ) {
break;
}
}
$term_color = get_term_meta( $term->term_id, 'term-color', true );
$term_image_id = get_term_meta( $term->term_id, 'term-image-id', true );
if ( function_exists( 'aq_resize' ) ) {
$image_url = aq_resize( wp_get_attachment_thumb_url( $term_image_id ), 25, 25, true, true, true );
} else {
$image_url = wp_get_attachment_thumb_url( $term_image_id, 'thumbnail' );
}
if ( $term_image_id != '' && $term_image_id != 0 ) {
$style = 'background-image:url(' . $image_url . ');';
$class = 'imagelabel';
$name = '';
} elseif ( $term_color != '' ) {
$style = 'background-color:' . $term_color . ';';
$class = 'colorlabel';
$name = '';
} else {
$style = '';
$class = 'selectlabel';
$name = $term->name;
}
if ( in_array( $term->slug, $value ) ) {
if ( ! isset( $data_variation_id[ $term->slug ] ) ) {
continue;
}
if ( ! empty( $variation_sale_price[ $term->slug ] ) ) {
$sale_price = $variation_sale_price[ $term->slug ];
} else {
$sale_price = '';
}
echo '
' . $name . ' ';
$proccessed_variation += 1;
}
}
}
// show only 3 variations
if ( ! $show_all_variations ) {
if ( $proccessed_variation < count( $available_variations ) ) {
echo "
+" . ( count( $available_variations ) - $proccessed_variation ) . " ";
}
}
echo '
';
}
}
}
}
}
/*-----------------------------------------------------------------*/
// Sku in ProductDetail Page
/*-----------------------------------------------------------------*/
if ( ! function_exists( 'kite_summary_add_sku' ) ) {
function kite_summary_add_sku() {
if ( kite_opt( 'single_product_meta', true ) ) {
return;
}
global $product;
$sku = $product->get_sku();
if ( $sku != '' ) {
echo "" . esc_html__( 'SKU: ', 'teta-lite' ) . $sku . '
';
}
}
}
add_action( 'woocommerce_after_add_to_cart_button', 'kite_summary_add_sku', 20 );
/*-----------------------------------------------------------------*/
// Add Wishlist Button
/*-----------------------------------------------------------------*/
if ( ! function_exists( 'yith_add_loop_wishlist' ) ) {
function yith_add_loop_wishlist() {
if ( class_exists( 'YITH_WCWL' ) ) {
echo do_shortcode( '[yith_wcwl_add_to_wishlist]' );
}
}
}
/*-----------------------------------------------------------------*/
// Custom label
/*-----------------------------------------------------------------*/
if ( ! function_exists( 'kite_custom_label' ) ) {
function kite_custom_label() {
$custom_product_label = get_post_meta( get_the_ID(), 'custom_product_label', true );
$lable_bg = get_post_meta( get_the_ID(), 'product_lable_bg', true );
if ( ! empty( $custom_product_label ) ) { ?>
style = "background-color: ;" >
is_on_sale() ) {
return;
}
$maximumper = 0;
if ( $product->is_type( 'variable' ) ) {
$maximumper = 0;
$available_variations = $product->get_available_variations();
for ( $i = 0; $i < count( $available_variations ); ++$i ) {
$variation_id = $available_variations[ $i ]['variation_id'];
$variation = new WC_Product_Variation( $variation_id );
$regular_price = $variation->get_regular_price();
$sale_price = $variation->get_sale_price();
if ( $regular_price == 0 || $regular_price == $sale_price || $sale_price == null ) {
continue;
}
$savings = ceil( ( ( $regular_price - $sale_price ) / $regular_price ) * 100 );
if ( $savings > $maximumper ) {
$maximumper = $savings;
}
}
} elseif ( $product->is_type( 'simple' ) || $product->is_type( 'external' ) ) {
$sale_price = $product->get_sale_price();
$regular_price = $product->get_regular_price();
if ( $regular_price == 0 ) {
return;
}
$savings = ceil( ( ( $regular_price - $sale_price ) / $regular_price ) * 100 );
$maximumper = $savings;
} elseif ( $product->is_type( 'grouped' ) ) {
$product_id = $product->get_id();
$childs_id = $product->get_children();
$maximumper = 0;
for ( $i = 0; $i < count( $childs_id ); ++$i ) {
$product_child_id = $childs_id[ $i ];
$simple = wc_get_product( $product_child_id );
if ( $product->is_type( 'simple' ) ) {
$regular_price = $product->get_regular_price();
$sale_price = $product->get_sale_price();
$savings = ceil( ( ( $regular_price - $sale_price ) / $regular_price ) * 100 );
if ( $regular_price == 0 ) {
continue;
}
if ( $savings > $maximumper ) {
$maximumper = $savings;
}
}
}
}
if ( $maximumper == 0 ) {
return;
}
echo wp_kses( '' . '-' . $maximumper . '%' . ' ', $GLOBALS['kite-allowed-tags'] );
}
}
/*-----------------------------------------------------------------*/
// Shop Header Display
/*-----------------------------------------------------------------*/
function kite_shop_header_display( $wp_customize ) {
$wp_customize->add_setting(
KITE_THEME_SLUG . '_shop_header_display',
array(
'capability' => 'edit_theme_options',
'default' => 'cat_icon',
'transport' => 'refresh',
'type' => 'option',
'sanitize_callback' => function( $input, $setting ) {
$input = sanitize_key( $input );
$choices = $setting->manager->get_control( $setting->id )->choices;
return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
},
)
);
$wp_customize->add_control(
KITE_THEME_SLUG . '_shop_header_display',
array(
'label' => esc_html__( 'Shop and Category page header display', 'teta-lite' ),
'description' => esc_html__( 'Choose which categories style to display on the shop and product category page header.', 'teta-lite' ),
'section' => 'woocommerce_product_catalog',
'settings' => KITE_THEME_SLUG . '_shop_header_display',
'type' => 'select',
'choices' => array(
'cat_sub' => esc_html__( 'Extended categories', 'teta-lite' ),
'cat_icon' => esc_html__( 'Categories by icon', 'teta-lite' ),
'cat_image' => esc_html__( 'Categories by image', 'teta-lite' ),
),
)
);
}
add_action( 'customize_register', 'kite_shop_header_display' );
//
// ─── ADD QUANTITY INPUT IN WOOCOMMERCE QUANTITY TEMPLATE ────────────────────────
//
add_action( 'woocommerce_after_quantity_input_field', 'kite_add_quantity_field' );
function kite_add_quantity_field() {
echo '
';
echo '
';
}
//
// ─── ADD_TO_CART_BUTTON ATTRIBUTES ──────────────────────────────────────────
//
add_filter( 'kite_loop_add_to_cart_button_attributes', 'kite_add_attribute_to_cart_button', 1, 3);
function kite_add_attribute_to_cart_button( $data_attribute, $product, $ajax_add_to_cart ) {
// $min_quantity and $max_quantity sets from woo-min-max-quantities plugin
return $data_attribute = array(
'data-min-quantity' => kite_get_min_product_quantity(),
'data-product_id' => $product->get_id(),
'data-product_sku' => $product->get_sku(),
'data-quantity' => kite_get_min_product_quantity(),
'class' => 'addcartbutton ' . ( $product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '' ) . ' product_type_' . $product->get_type() . ( $product->get_type() == 'simple' && 'yes' === $ajax_add_to_cart ? ' ajax_add_to_cart' : '' ) . ( 'yes' === get_option( 'woocommerce_enable_ajax_add_to_cart' ) ? ' ajax_enabled' : '' )
);
}
//
// ─── GET MINIMUM WOOCOMMERCE QUANTITY ───────────────────────────────────────────
//
function kite_get_min_product_quantity( $product = '') {
if ( empty( $product ) ) {
global $product;
}
$quantity = get_post_meta( $product->get_id(), 'minimum_allowed_quantity' , true );
return $quantity ? $quantity : 1 ;
}
//
// ─── ADD SPACER TO TABS SECTION ─────────────────────────────────────────────────
//
function kite_add_spacer_to_tabs_section() {
echo "
";
}
add_action( 'woocommerce_product_after_tabs', 'kite_add_spacer_to_tabs_section', 99 );
// check if shop page comes from products page or not when pagination is infinite scroll or load more
add_filter( 'get_pagenum_link', 'kite_add_infinite_scroll_arg', 1 );
function kite_add_infinite_scroll_arg( $result ) {
return ( ( is_shop() || is_product_category() || is_product_tag() ) && kite_opt( 'products-pagination', 'pagination') != 'pagination' ) ? add_query_arg( array( 'sp' => false ), $result ) : $result;
}
// check if shop page comes from products page load seen products before current page
add_action( 'kite_products_loop_start', 'kite_show_seen_products' );
function kite_show_seen_products() {
global $paged, $wp_query;
if ( ! $paged || $paged == 1 ) {
return;
}
if ( ( is_shop() || is_product_category() || is_product_tag() ) && kite_opt( 'products-pagination', 'pagination') != 'pagination' && ! empty( $_GET['sp'] ) && $_GET['sp'] == 'infinite_scroll' ) {
$per_page = kite_opt( 'shop-item-per-page', 12 );
$per_page = ( $paged - 1 ) * $per_page;
$args = $wp_query->query_vars;
$seen_products = [];
for ( $i = 1; $i < $paged; $i++ ) {
$args['paged'] = $i;
$products = new WP_Query( $args );
$seen_products = array_merge( $seen_products, $products->posts );
}
$wp_query->posts = array_merge( $seen_products, $wp_query->posts );
$wp_query->posts_per_page = count( $wp_query->posts );
$wp_query->post_count = count( $wp_query->posts );
}
}
//
// ─── WOOCOMMERCE PAGINATION ─────────────────────────────────────────────────────
//
add_filter( 'woocommerce_pagination_args', 'kite_woocommerce_pagination', 1 , 99 );
function kite_woocommerce_pagination( $args ) {
$args['prev_text'] = '← ' . esc_html__( 'Prev.', 'teta-lite' );
$args['next_text'] = esc_html__( 'Next', 'teta-lite' ) . ' →';
if ( wp_is_mobile() ) {
$args['end_size'] = 1;
$args['mid_size'] = 1;
}
return $args;
}
//
// ─── CHANGE COUPON FORM POSITION ────────────────────────────────────────────────
//
add_action( 'init', 'kite_change_coupon_form_position' );
function kite_change_coupon_form_position() {
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );
add_action( 'woocommerce_checkout_before_order_review', 'woocommerce_checkout_coupon_form' );
}
//
// ─── CHECK IF SHIPPING CALCULATRO IS ENABLED OR NOT ─────────────────────────────
//
add_filter( 'woocommerce_shipping_show_shipping_calculator', 'kite_is_shipping_calculator_enabled', 1, 1 );
function kite_is_shipping_calculator_enabled( $first ) {
if ( 'no' === get_option( 'woocommerce_enable_shipping_calc' ) || ! WC()->cart->needs_shipping() ) {
return false;
}
return $first;
}
//
// ─── MOVE CROSS SELLS TO BOTTOM OF PAGE IN CART ─────────────────────────────────
//
remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );
add_action( 'woocommerce_after_cart_table', 'woocommerce_cross_sell_display' );
/**
* append dokan vendors list to ajax search results
*
* @param $results
*
* @return mixed
*/
function kite_append_dokan_vendors_list_to_ajax_search( $output, $search_results ) {
if ( !kite_opt( 'trident_search_enabled_vendors', false ) || !function_exists( 'dokan' ) ) {
return $output;
}
$output[] = "" . esc_html__( 'Vendors', 'teta-lite' ) . " ";
$authors = [];
foreach ( $search_results as $result ) {
if ( !in_array( $result->post_author, $authors ) ) {
$authors[] = $result->post_author;
}
}
if ( !empty( $authors ) ) {
$output[] = '';
foreach ( $authors as $author ) {
if ( get_user_meta( $author, 'dokan_enable_selling', true ) == 'yes' ) {
$author_dokan_info = maybe_unserialize( get_user_meta( $author, 'dokan_profile_settings', true ) );
$store_name = !empty( $author_dokan_info['store_name'] ) ? $author_dokan_info['store_name'] : '';
$banner = !empty( $author_dokan_info['banner'] ) ? wp_get_attachment_image( $author_dokan_info['banner'], 'medium' ) : wp_get_attachment_image( get_option( 'woocommerce_placeholder_image', 0 ), 'medium' );
$avatar = !empty( $author_dokan_info['banner'] ) ? wp_get_attachment_image( $author_dokan_info['gravatar'], 'thumbnail' ) : wp_get_attachment_image( get_option( 'woocommerce_placeholder_image', 0 ), 'thumbnail' );
$vendor = dokan()->vendor->get( $author );
$output[] = sprintf( '
', $vendor->get_shop_url(), $banner, $avatar, $store_name );
}
}
$output[] = "
";
}
return $output;
}
add_filter( 'kite_ajax_search_results', 'kite_append_dokan_vendors_list_to_ajax_search', 1, 2 );
/**
* Add meta field of single product in head to use in facebook crawler for share button
*
* @return void
*/
function kite_add_single_product_meta_fields_in_head() {
if ( !is_product() || !is_single() ) {
return;
}
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
}
add_action( 'wp_head', 'kite_add_single_product_meta_fields_in_head');