‘ . get_the_title() . ‘

‘;
}
}

/**
* ————————————————————————————————
* Checkout steps in page title
* ————————————————————————————————
*/

if( ! function_exists( ‘woodmart_checkout_steps’ ) ) {
function woodmart_checkout_steps() {

?>

  • “>

  • “>

‘;
}
}

/**
* ————————————————————————————————
* Hover image
* ————————————————————————————————
*/

if( ! function_exists( ‘woodmart_hover_image’ ) ) {
function woodmart_hover_image() {
global $product;

$attachment_ids = $product->get_gallery_image_ids();

$hover_image = ”;

if ( ! empty( $attachment_ids[0] ) ) {
$hover_image = woodmart_get_product_thumbnail( ‘woocommerce_thumbnail’, $attachment_ids[0] );
}

if( $hover_image != ” && woodmart_get_opt( ‘hover_image’ ) ): ?>

‘;
}
}

if( ! function_exists( ‘woodmart_woo_wrapper_end’ ) ) {
function woodmart_woo_wrapper_end() {
echo ‘

‘;
}
}

/**
* ————————————————————————————————
* My account sidebar
* ————————————————————————————————
*/

if( ! function_exists( ‘woodmart_before_my_account_navigation’ ) ) {
function woodmart_before_my_account_navigation() {
echo ‘

‘;
}
add_action( ‘woocommerce_checkout_order_review’, ‘woodmart_close_table_wrapper_div’, 13 );
}

// **********************************************************************//
// ! Items per page select on the shop page
// **********************************************************************//

if( ! function_exists( ‘woodmart_show_sidebar_btn’ ) ) {

add_action( ‘woocommerce_before_shop_loop’, ‘woodmart_show_sidebar_btn’, 25 );

function woodmart_show_sidebar_btn() {
if ( wc_get_loop_prop( ‘is_shortcode’ ) || ! wc_get_loop_prop( ‘is_paginated’ ) ) return;

?>


$value ) :
?>

‘;

echo ‘

‘;
}
}

/**
* ————————————————————————————————
* Display ancestors of current category
* ————————————————————————————————
*/

if( ! function_exists( ‘woodmart_show_category_ancestors’ )) {
function woodmart_show_category_ancestors() {
global $wp_query, $post;

$current_cat = false;
$list_args = array();

$show_categories_neighbors = woodmart_get_opt( ‘show_categories_neighbors’ );

if ( is_tax(‘product_cat’) ) {
$current_cat = $wp_query->queried_object;
}

$list_args = array( ‘taxonomy’ => ‘product_cat’, ‘hide_empty’ => true );

// Show Siblings and Children Only
if ( $current_cat ) {

// Direct children are wanted
$include = get_terms(
‘product_cat’,
array(
‘fields’ => ‘ids’,
‘parent’ => $current_cat->term_id,
‘hierarchical’ => true,
‘hide_empty’ => false
)
);

$list_args[‘include’] = implode( ‘,’, $include );

if ( empty( $include ) && !$show_categories_neighbors ) {
return;
}

if ( $show_categories_neighbors ) {
if ( get_term_children( $current_cat->term_id, ‘product_cat’ ) ) {
$list_args[‘child_of’] = $current_cat->term_id;
}elseif( $current_cat->parent != 0 ){
$list_args[‘child_of’] = $current_cat->parent;
}
}
}

$list_args[‘depth’] = 1;
$list_args[‘hierarchical’] = 1;
$list_args[‘title_li’] = ”;
$list_args[‘pad_counts’] = 1;
$list_args[‘show_option_none’] = esc_html__(‘No product categories exist.’, ‘woodmart’ );
$list_args[‘current_category’] = ( $current_cat ) ? $current_cat->term_id : ”;
$list_args[‘show_count’] = woodmart_get_opt( ‘shop_products_count’ );
$list_args[‘walker’] = new WOODMART_Walker_Category();

wp_list_categories( $list_args );
}
}

if( ! class_exists( ‘WOODMART_Walker_Category’ ) ) {
class WOODMART_Walker_Category extends Walker_Category {
public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
/** This filter is documented in wp-includes/category-template.php */
$cat_name = apply_filters(
‘list_cats’,
esc_attr( $category->name ),
$category
);

// Don’t generate an element if the category name is empty.
if ( ! $cat_name ) {
return;
}

$link = ‘

‘;

if ( ‘list’ == $args[‘style’] ) {
$default_cat = get_option( ‘default_product_cat’ );
$output .= “\tterm_id,
( $category->term_id == $default_cat ? ‘wc-default-cat’ : ”)
);

if ( ! empty( $args[‘current_category’] ) ) {
// ‘current_category’ can be an array, so we use `get_terms()`.
$_current_terms = get_terms( $category->taxonomy, array(
‘include’ => $args[‘current_category’],
‘hide_empty’ => false,
) );

foreach ( $_current_terms as $_current_term ) {
if ( $category->term_id == $_current_term->term_id ) {
$css_classes[] = ‘current-cat’;
} elseif ( $category->term_id == $_current_term->parent ) {
$css_classes[] = ‘current-cat-parent’;
}
while ( $_current_term->parent ) {
if ( $category->term_id == $_current_term->parent ) {
$css_classes[] = ‘current-cat-ancestor’;
break;
}
$_current_term = get_term( $_current_term->parent, $category->taxonomy );
}
}
}

/**
* Filter the list of CSS classes to include with each category in the list.
*
* @since 4.2.0
*
* @see wp_list_categories()
*
* @param array $css_classes An array of CSS classes to be applied to each list item.
* @param object $category Category data object.
* @param int $depth Depth of page, used for padding.
* @param array $args An array of wp_list_categories() arguments.
*/
$css_classes = implode( ‘ ‘, apply_filters( ‘category_css_class’, $css_classes, $category, $depth, $args ) );

$output .= ‘ class=”‘ . $css_classes . ‘”‘;
$output .= “>$link\n”;
} elseif ( isset( $args[‘separator’] ) ) {
$output .= “\t$link” . $args[‘separator’] . “\n”;
} else {
$output .= “\t$link
\n”;
}
}
}
}

if ( ! class_exists( ‘WOODMART_WC_Product_Cat_List_Walker’ ) && function_exists(‘WC’) ) :

include_once( WC()->plugin_path() . ‘/includes/walkers/class-product-cat-list-walker.php’ );

class WOODMART_WC_Product_Cat_List_Walker extends WC_Product_Cat_List_Walker {

/**
* Start the element output.
*
* @see Walker::start_el()
* @since 2.1.0
*
* @param string $output Passed by reference. Used to append additional content.
* @param int $depth Depth of category in reference to parents.
* @param integer $current_object_id
*/
public function start_el( &$output, $cat, $depth = 0, $args = array(), $current_object_id = 0 ) {
$output .= ‘

  • term_id, $this->tree_type ) . ‘”>’ . $cat->name . ‘‘;

    if ( $args[‘show_count’] ) {
    $output .= ‘ ‘ . $cat->count . ‘‘;
    }
    }
    }

    endif;

    /**
    * ————————————————————————————————
    * Show product categories
    * ————————————————————————————————
    */

    if( ! function_exists( ‘woodmart_product_categories’ ) ) {
    function woodmart_product_categories() {
    global $post, $product;
    if( ! woodmart_get_opt( ‘categories_under_title’ ) ) return;
    ?>

    get_id(), ‘, ‘ );
    ?>

    ‘ . esc_html__(‘დეტალურად ნახვა’, ‘woodmart’) . ‘‘;
    }
    }

    /**
    * ————————————————————————————————
    * Function returns numbers of items in the cart. Filter woocommerce fragments
    * ————————————————————————————————
    */

    if( ! function_exists( ‘woodmart_cart_data’ ) ) {
    add_filter(‘woocommerce_add_to_cart_fragments’, ‘woodmart_cart_data’, 30);
    function woodmart_cart_data( $array ) {
    ob_start();
    woodmart_cart_count();
    $count = ob_get_clean();

    ob_start();
    woodmart_cart_subtotal();
    $subtotal = ob_get_clean();

    $array[‘span.woodmart-cart-number’] = $count;
    $array[‘span.woodmart-cart-subtotal’] = $subtotal;

    return $array;
    }
    }

    if( ! function_exists( ‘woodmart_cart_count’ ) ) {
    function woodmart_cart_count() {
    $count = WC()->cart->get_cart_contents_count();
    ?>


    cart->get_cart_subtotal(); ?>
    is_on_sale() ) {

    $percentage = ”;

    if ( $product->get_type() == ‘variable’ && $percentage_label ) {

    $available_variations = $product->get_variation_prices();
    $max_percentage = 0;

    foreach( $available_variations[‘regular_price’] as $key => $regular_price ) {
    $sale_price = $available_variations[‘sale_price’][$key];

    if ( $sale_price < $regular_price ) { $percentage = round( ( ( $regular_price - $sale_price ) / $regular_price ) * 100 ); if ( $percentage > $max_percentage ) {
    $max_percentage = $percentage;
    }
    }
    }

    $percentage = $max_percentage;
    } elseif ( ( $product->get_type() == ‘simple’ || $product->get_type() == ‘external’ ) && $percentage_label ) {
    $percentage = round( ( ( $product->get_regular_price() – $product->get_sale_price() ) / $product->get_regular_price() ) * 100 );
    }

    if ( $percentage ) {
    $output[] = ‘-‘ . $percentage . ‘%’ . ‘‘;
    }else{
    $output[] = ‘‘ . esc_html__( ‘Sale’, ‘woodmart’ ) . ‘‘;
    }
    }

    if( !$product->is_in_stock() ){
    $output[] = ‘‘ . esc_html__( ‘Sold out’, ‘woodmart’ ) . ‘‘;
    }

    if ( $product->is_featured() && woodmart_get_opt( ‘hot_label’ ) ) {
    $output[] = ‘‘ . esc_html__( ‘Hot’, ‘woodmart’ ) . ‘‘;
    }

    if ( get_post_meta( get_the_ID(), ‘_woodmart_new_label’, true ) && woodmart_get_opt( ‘new_label’ ) ) {
    $output[] = ‘‘ . esc_html__( ‘New’, ‘woodmart’ ) . ‘‘;
    }

    if ( $product_attributes ) {
    foreach ( $product_attributes as $attribute ) {
    $output[] = $attribute;
    }
    }

    if ( $output ) {
    echo ‘

    ‘ . implode( ”, $output ) . ‘

    ‘;
    }
    }
    }
    add_filter( ‘woocommerce_sale_flash’, ‘woodmart_product_label’, 10 );

    /**
    * ————————————————————————————————
    * Woodmart my account links
    * ————————————————————————————————
    */
    if( ! function_exists( ‘woodmart_my_account_links’ ) ) {
    function woodmart_my_account_links() {
    if ( !woodmart_get_opt( ‘my_account_links’ ) ) return;
    ?>


    ‘;
    }
    add_action( ‘woocommerce_account_navigation’, ‘woodmart_my_account_wrapp_start’, 1 );
    }

    if( ! function_exists( ‘woodmart_my_account_wrapp_end’ ) ) {
    function woodmart_my_account_wrapp_end(){
    echo ‘