';
// 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 '';
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,">";
}
}
function avova_fn_close_product_wrap()
{
if(!is_single()){
echo "
";
}
}
function avova_fn_open_image_div()
{
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( '