1000, 'gallery_thumbnail_image_width' => 100, 'single_image_width' => 1000, ) ); } add_action( 'after_setup_theme', 'alagu_woo_support' ); } // Products Per Row - Need to override "Products per row" option in "Product Catalog" customizer settings if( ! function_exists( 'alagu_woo_loop_columns' ) ) { function alagu_woo_loop_columns( $columns ) { return $columns; } add_filter( 'loop_shop_columns', 'alagu_woo_loop_columns' ); } // Post Per Page if( ! function_exists( 'alagu_woo_posts_per_page' ) ) { function alagu_woo_posts_per_page( $count ) { if( is_shop() ) { $count = alagu_get_option( 'shop-page-product-per-page', $count ); } elseif( is_product_category() ) { $count = alagu_get_option( 'dt-woo-category-archive-product-per-page' ); } elseif( is_product_tag() ) { $count = alagu_get_option( 'dt-woo-tag-archive-product-per-page' ); } return $count; } add_filter( 'loop_shop_per_page', 'alagu_woo_posts_per_page' ); } /** * ------------------------------------------------------------------------------------------------ * Main Content Wrapper * ------------------------------------------------------------------------------------------------ */ // To Update Page Wrapper Start remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 ); if( ! function_exists( 'alagu_woo_output_content_wrapper' ) ) { function alagu_woo_output_content_wrapper() { $shop_page_id = ''; $settings = array(); $page_layout = ''; $sidebar_class = ''; $show_sidebar = ''; $show_left_sidebar = ''; $container_class = ''; $widgets = array(); if( is_shop() || is_product_category() || is_product_tag() ) { $options = alagu_shop_archive_page(); $widgets = $options['widgets']; $layout = $options['page-layout']; $layout = alagu_page_layout( $layout ); extract( $layout ); } elseif( is_product() ) { global $post; $options = alagu_single_product( $post->ID, "left" ); $widgets = $options['widgets']; $layout = $options['page-layout']; $layout = alagu_page_layout( $layout ); extract( $layout ); } $header_class = alagu_get_option( 'breadcrumb-position' ); echo ''; echo '
'; echo ''; echo ''; echo ''; # Shop if( is_shop() ) { $shop_page_enable_breadcrumb = alagu_get_option( 'shop-page-enable-breadcrumb' ); $shop_page_enable_breadcrumb = (isset($shop_page_enable_breadcrumb) && !empty($shop_page_enable_breadcrumb)) ? true : false; if($shop_page_enable_breadcrumb) { if( get_option('woocommerce_shop_page_id') == '' ) { $breadcrumbs[] = ''.esc_html__('Shop', 'alagu').''; $bstyle = alagu_get_option( 'breadcrumb-style', 'default' ); $style = alagu_breadcrumb_css(); alagu_breadcrumb_output ( '

'.esc_html__('Shop', 'alagu').'

', $breadcrumbs, $bstyle, $style ); } else { $breadcrumbs[] = ''.get_the_title( get_option('woocommerce_shop_page_id') ).''; $bstyle = alagu_get_option( 'breadcrumb-style', 'default' ); $style = alagu_breadcrumb_css(); alagu_breadcrumb_output ( '

'.get_the_title( get_option('woocommerce_shop_page_id') ).'

', $breadcrumbs, $bstyle, $style ); } } } # Product if( is_product() ) { $dt_single_product_enable_breadcrumb = alagu_get_option( 'dt-single-product-enable-breadcrumb' ); $dt_single_product_enable_breadcrumb = (isset($dt_single_product_enable_breadcrumb) && !empty($dt_single_product_enable_breadcrumb)) ? true : false; if($dt_single_product_enable_breadcrumb) { global $post; $terms = wc_get_product_terms( $post->ID, 'product_cat', apply_filters( 'woocommerce_breadcrumb_product_terms_args', array( 'orderby' => 'parent', 'order' => 'DESC', ) ) ); $breadcrumbs[] = isset($terms[0]) ? ''.$terms[0]->name.'': ''; $breadcrumbs[] = the_title( '', '', false ); $bstyle = alagu_get_option( 'breadcrumb-style', 'default' ); $style = alagu_breadcrumb_css(); alagu_breadcrumb_output ( '

'.esc_html__('Shop', 'alagu').'

', $breadcrumbs, $bstyle, $style ); } } # Product Category if( is_product_category() ) { $dt_woo_category_archive_enable_breadcrumb = alagu_get_option( 'dt-woo-category-archive-enable-breadcrumb' ); $dt_woo_category_archive_enable_breadcrumb = (isset($dt_woo_category_archive_enable_breadcrumb) && !empty($dt_woo_category_archive_enable_breadcrumb)) ? true : false; if($dt_woo_category_archive_enable_breadcrumb) { $breadcrumbs[] = '' . get_the_title( get_option('woocommerce_shop_page_id') ). ''; $breadcrumbs[] = ''.single_term_title( '', false ).''; $bstyle = alagu_get_option( 'breadcrumb-style', 'default' ); $style = alagu_breadcrumb_css(); alagu_breadcrumb_output ( '

'.single_term_title( '', false ).'

', $breadcrumbs, $bstyle, $style ); } } # Product Tag if( is_product_tag() ) { $dt_woo_tag_archive_enable_breadcrumb = alagu_get_option( 'dt-woo-tag-archive-enable-breadcrumb' ); $dt_woo_tag_archive_enable_breadcrumb = (isset($dt_woo_tag_archive_enable_breadcrumb) && !empty($dt_woo_tag_archive_enable_breadcrumb)) ? true : false; if($dt_woo_tag_archive_enable_breadcrumb) { $breadcrumbs[] = '' . get_the_title( get_option('woocommerce_shop_page_id') ). ''; $breadcrumbs[] = ''.single_term_title( '', false ).''; $bstyle = alagu_get_option( 'breadcrumb-style', 'default' ); $style = alagu_breadcrumb_css(); alagu_breadcrumb_output ( '

'.single_term_title( '', false ).'

', $breadcrumbs, $bstyle, $style ); } } echo '
'; echo ''; echo ''; echo '
'; echo ''; echo '
'; # Left Sidebar if ( $show_sidebar ) { if ( $show_left_sidebar ) { $wtstyle = alagu_get_option( 'wtitle-style' ); echo '
'; echo !empty( $wtstyle ) ? "
" : ''; foreach( $widgets as $widget ) { dynamic_sidebar( $widget ); } echo !empty( $wtstyle ) ? '
' : ''; echo '
'; } } # Left Sidebar echo ''; echo '
'; } add_action( 'woocommerce_before_main_content', 'alagu_woo_output_content_wrapper', 11 ); } // To Update Page wrapper End remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); if( ! function_exists( 'alagu_woo_output_content_wrapper_end' ) ) { function alagu_woo_output_content_wrapper_end() { $shop_page_id = ''; $settings = array(); $sidebar_class = ''; $show_sidebar = ''; $show_right_sidebar = ''; $widgets = array(); if( is_shop() ) { $shop_page_bottom_hook = alagu_get_option( 'shop-page-bottom-hook' ); $shop_page_bottom_hook = (isset($shop_page_bottom_hook) && !empty($shop_page_bottom_hook)) ? $shop_page_bottom_hook : false; if($shop_page_bottom_hook) { echo do_shortcode($shop_page_bottom_hook); } } echo '
'; echo ''; if( is_shop() || is_product_category() || is_product_tag() ) { $options = alagu_shop_archive_page(); $widgets = $options['widgets']; $layout = $options['page-layout']; $layout = alagu_page_layout( $layout ); extract( $layout ); } elseif( is_product() ) { global $post; $options = alagu_single_product( $post->ID, "right" ); $widgets = $options['widgets']; $layout = $options['page-layout']; $layout = alagu_page_layout( $layout ); extract( $layout ); } # Right Sidebar if ( $show_sidebar ) { if ( $show_right_sidebar ) { $wtstyle = alagu_get_option( 'wtitle-style' ); echo '
'; echo !empty( $wtstyle ) ? "
" : ''; foreach( $widgets as $widget ) { dynamic_sidebar( $widget ); } echo !empty( $wtstyle ) ? '
' : ''; echo '
'; } } # Right Sidebar echo '
'; echo ''; echo '
'; echo ''; } add_action( 'woocommerce_after_main_content', 'alagu_woo_output_content_wrapper_end', 11 ); } ?>