'; echo '
'; // Title Bar if($avova_fn_pagetitle != 'disable' && !is_single()){ echo '
'; echo '

'; if(is_product()) { the_title(); } else { woocommerce_page_title(); } echo '

'; avova_fn_breadcrumbs(); echo '
'; echo '
'; echo '
'; echo '
'; } $containerOpener = '
'; // Content echo '
'.$containerOpener.'
'; // if full if($avova_fn_pagestyle != 'ws' && !is_single()){ if(is_product_category()){ if(isset($avova_fn_option)){ if(isset($avova_fn_option['woo_category_product_sidebar']) && $avova_fn_option['woo_category_product_sidebar'] === 'enable'){ echo '
'; } } }else{ echo '
'; } } // if we have sidebar if(($avova_fn_pagestyle == 'ws') && !is_single()){ echo '
'; } if(is_single()){ echo '
'; } } function avova_fn_woocommerce_after_avova_fn_main_content(){ global $post, $avova_fn_option; if(is_shop()) { $pageID = get_option('woocommerce_shop_page_id'); } else { $pageID = get_the_ID(); } $avova_fn_top_padding = get_post_meta($pageID,'avova_fn_page_padding_top', true); $avova_fn_bot_padding = get_post_meta($pageID,'avova_fn_page_padding_bottom', true); $avova_fn_page_spaces = 'style='; if($avova_fn_top_padding != ''){$avova_fn_page_spaces .= 'padding-top:'.$avova_fn_top_padding.'px;';} if($avova_fn_bot_padding != ''){$avova_fn_page_spaces .= 'padding-bottom:'.$avova_fn_bot_padding.'px;';} if($avova_fn_top_padding == '' && $avova_fn_bot_padding == ''){$avova_fn_page_spaces = '';} if(is_shop()) { $pageID = get_option('woocommerce_shop_page_id'); } else { $pageID = get_the_ID(); } $avova_fn_pagestyle = get_post_meta($pageID,'avova_fn_page_style', true); if($avova_fn_pagestyle != 'ws' && !is_single()){ if(is_product_category()){ if(isset($avova_fn_option)){ if(isset($avova_fn_option['woo_category_product_sidebar']) && $avova_fn_option['woo_category_product_sidebar'] === 'enable'){ echo '
'; echo '
'; get_sidebar(); echo '
'; } } }else{ echo '
'; // end full } } // if we have sidebar if(($avova_fn_pagestyle == 'ws') && !is_single()){ echo '
'; echo '
'; get_sidebar(); echo '
'; } $containerCloser = '
'; echo '
'.$containerCloser.'
'; // end content if(is_single()){ echo '
'; } echo '
'; echo ''; // end content wrapper } // PRODUCTS PER PAGE function avova_fn_loop_shop_per_page() { global $avova_fn_option; if(isset($avova_fn_option['woo_per_page']) == 1 && $avova_fn_option['woo_per_page']) { $per_page = $avova_fn_option['woo_per_page']; } else { $per_page = 12; } return esc_html($per_page); } function avova_fn_woocommerce_thumbnail() { global $product, $avova_fn_option; if ($product->get_type() == 'bundle' ){ $product = new WC_Product_Bundle($product->get_id()); } $rating = wc_get_rating_html( $product->get_average_rating() ); $onsale = $product->is_on_sale(); //on sale $permalink = get_permalink( $product->get_id() ); $price = $product->get_price_html(); $title = $product->get_title(); $id = get_the_ID(); if(isset($avova_fn_option['woo_product_img_grid'])){ $productsGridType = $avova_fn_option['woo_product_img_grid']; }else{ $productsGridType = 'square'; } if($productsGridType == 'square'){ $productThumb = avova_fn_callback_thumbs('square'); }else if($productsGridType == 'portrait'){ $productThumb = avova_fn_callback_thumbs(800,970); }else if($productsGridType == 'landscape'){ $productThumb = avova_fn_callback_thumbs(700,570); } echo "
"; echo wp_kses_post($productThumb); echo '
'; if($product->get_type() == 'simple') echo ""; avova_fn_add_cart_button(); echo ""; if($onsale == 1){ echo "" .esc_html__('Sale', 'avova') .""; } echo "
"; } // NEW ADD TO CART BUTTON function avova_fn_add_cart_button() { global $product; if ($product->get_type() == 'bundle' ){ $product = new WC_Product_Bundle($product->get_id()); } $extraClass = ""; ob_start(); woocommerce_template_loop_add_to_cart(); $output = ob_get_clean(); if(!empty($output)) { $pos = strpos($output, ">"); if ($pos !== false) { $output = substr_replace($output,"> ", $pos , strlen(1)); } } if(empty($extraClass)) $output .= ""; if($output) echo "
$output
"; } function woo_custom_cart_button_text() { return ''; } function avova_fn_shop_overview_extra_header_div() { global $product; if ($product->get_type() == 'bundle' ){ $product = new WC_Product_Bundle($product->get_id()); } echo "
"; } function avova_fn_close_div() { echo "
"; } function avova_fn_wrap_sorting() { echo "
"; } function avova_fn_wrap_sorting_end() { echo "
"; } function avova_fn_wrap_crumb() { echo "
"; } function avova_fn_wrap_crumb_end() { echo "
"; } function avova_fn_woocommerce_breadcrumbs() { return array( 'delimiter' => ' / ', 'wrap_before' => '', 'before' => '', 'after' => '', 'home' => esc_html__( 'Home', 'avova' ), ); } function avova_fn_open_product_wrap() { if(!is_single()){ echo "
"; } } function avova_fn_close_product_wrap() { if(!is_single()){ echo "
"; } } function avova_fn_open_image_div() { echo "
"; } function avova_fn_close_image_div() { echo "
"; } function avova_fn_open_summary_div() { echo "
"; } function avova_fn_close_summary_div() { echo "
"; } function avova_fn_woocommerce_output_related_products() { $output = ""; $defaults = array( 'posts_per_page' => 4, 'columns' => 4, 'orderby' => 'rand' ); ob_start(); woocommerce_related_products($defaults); $content = ob_get_clean(); if($content) { $output .= '
'; echo wp_kses_post($output); } } // define the woocommerce_before_cart callback function avova_fn_action_woocommerce_before_cart( $wccm_before_checkout ) { // make action magic happen here... echo "
"; } // define the woocommerce_after_cart callback function avova_fn_action_woocommerce_after_cart( $wccm_after_checkout ) { // make action magic happen here... echo '
'; } function avova_fn_remove_woo_lightbox(){ remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); wp_dequeue_style( 'woocommerce_prettyPhoto_css' ); wp_dequeue_script( 'prettyPhoto' ); wp_dequeue_script( 'prettyPhoto-init' ); } if(!function_exists('avova_fn_woocommerce_post_thumbnail_description')) { function avova_fn_woocommerce_post_thumbnail_description($img, $post_id) { global $post, $woocommerce, $product; if(has_post_thumbnail()) { $image_title = esc_attr(get_post_field('post_title', get_post_thumbnail_id())); $image_link = wp_get_attachment_url( get_post_thumbnail_id() ); $image = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ), array( 'title' => $image_title ) ); $attachment_count = count( $product->get_gallery_attachment_ids() ); if ( $attachment_count > 0 ) { $gallery = '[product-gallery]'; } else { $gallery = ''; } return sprintf( '%s', $image_link, $image_title, $image); } return wp_kses_post($img); } } if(!function_exists('avova_fn_woocommerce_gallery_thumbnail_description')) { function avova_fn_woocommerce_gallery_thumbnail_description($img, $attachment_id ) { $image_link = wp_get_attachment_url( $attachment_id ); if(!$image_link) return wp_kses_post($img); $image = wp_get_attachment_image( $attachment_id, apply_filters( 'single_product_small_thumbnail_size', 'shop_single' ) ); $image_title = esc_attr(get_post_field('post_title', $attachment_id)); $img = sprintf( '%s', $image_link, $image_title, $image ); return wp_kses_post($img); } } function avova_fn_woocommerce_cart_dropdown() { global $woocommerce; $cart_subtotal = $woocommerce->cart->get_cart_subtotal(); $link = $woocommerce->cart->get_cart_url(); $count = $woocommerce->cart->cart_contents_count; $html = ""; $html .= "
"; $html .= " " .$count. ""; $html .= '
"; echo wp_kses_post($html); } function avova_fn_header_add_to_cart_fragment( $fragments ) { global $woocommerce; ob_start(); ?> cart->cart_contents_count); ?> ID ); $full_size_image = wp_get_attachment_image_src( $post_thumbnail_id, $thumbnail_size ); $placeholder = has_post_thumbnail() ? 'with-images' : 'without-images'; $wrapper_classes = apply_filters( 'woocommerce_single_product_image_gallery_classes', array( 'woocommerce-product-gallery', 'woocommerce-product-gallery--' . $placeholder, 'woocommerce-product-gallery--columns-' . absint( $columns ), 'images', ) ); echo '
'; } function avova_fn_woo_product_thumbs(){ global $post, $product; $attachment_ids = $product->get_gallery_image_ids(); if ( $attachment_ids && has_post_thumbnail() ) { echo '
'; } }