Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * The Template for displaying product archives, including the main shop page which is a post type archive.
- *
- * Override this template by copying it to yourtheme/woocommerce/archive-product.php
- *
- * @author WooThemes
- * @package WooCommerce/Templates
- * @version 10.0.0
- */
- if (!defined('ABSPATH')) exit; // Exit if accessed directly
- get_header('shop');
- $product_query_args = array(
- 's' => get_search_query(),
- 'post_types' => 'product',
- 'posts_per_page' => 30,
- 'relevanssi' => true,
- 'orderby' => 'date',
- 'order' => 'desc'
- );
- $product_query = new WP_Query($product_query_args);
- do_action('woocommerce_before_main_content'); // update woocommerce
- ?>
- <?php $left_sidebar = (rehub_option('rehub_sidebar_left_shop')) ? true : false; ?>
- <?php if (is_tax('store')) : ?>
- <?php include(rh_locate_template('woocommerce/brandarchive.php')); ?>
- <?php else : ?>
- <?php $custom_shop_layout = rehub_option('woo_columns'); ?>
- <?php if (is_numeric($custom_shop_layout) && function_exists('rh_wp_reusable_render')) : ?>
- <div class="rh-container rh_woo_main_archive">
- <?php echo rh_wp_reusable_render(array('id' => $custom_shop_layout)); ?>
- </div>
- <?php else : ?>
- <!-- CONTENT -->
- <?php $display_type = ''; ?>
- <?php $display_type = woocommerce_get_loop_display_mode(); ?>
- <?php get_sidebar('shop'); ?>
- <!-- /Sidebar -->
- <?php endif; ?>
- <?php do_action('woocommerce_before_main_content'); ?>
- <?php do_action('woocommerce_archive_description'); ?>
- <?php if (woocommerce_product_loop()) : ?>
- <?php $shop_global = rehub_option('rh_woo_shop_global'); ?>
- <?php if ($shop_global) : ?>
- <?php if ('subcategories' === $display_type || 'both' === $display_type) : ?>
- <?php endif; ?>
- <div class="clearfix"></div>
- <?php echo do_shortcode($shop_global); ?>
- <div class="clearfix"></div>
- <?php else : ?>
- <?php
- do_action('woocommerce_before_shop_loop');
- //hot item
- include(rh_locate_template('woocommerce/hot-item.php'));
- ?>
- <?php if (function_exists('woocommerce_get_loop_display_mode')) : ?>
- <?php if ('subcategories' === $display_type || 'both' === $display_type) : ?>
- <?php endif; ?>
- <?php endif; ?>
- <?php woocommerce_product_loop_start(); ?>
- <?php if ($display_type != 'subcategories') : ?>
- <?php if ($product_query->have_posts()) : while ($product_query->have_posts()) : $product_query->the_post(); ?>
- <?php
- do_action('woocommerce_shop_loop');
- wc_get_template_part('content', 'product');
- ?>
- <?php endwhile; // end of the loop.
- ?>
- <?php endif; ?>
- <?php endif; ?>
- <?php woocommerce_product_loop_end(); ?>
- <?php do_action('woocommerce_after_shop_loop'); ?>
- <?php endif; ?>
- <?php else : ?>
- <?php wc_get_template('loop/no-products-found.php'); ?>
- <?php endif; ?>
- <?php
- if ((is_product_category() || is_product_tag()) && 0 === absint(get_query_var('paged'))) {
- if ($term) {
- $cat_sec_desc = get_term_meta($termid, 'brand_second_description', true);
- if ($cat_sec_desc) {
- echo '<div class="woo_cat_sec_description clearbox">' . wc_format_content($cat_sec_desc) . '</div>';
- }
- }
- }
- ?>
- <?php do_action('woocommerce_after_main_content');
- ?>
- <?php if (!$left_sidebar && rehub_option('woo_columns') != '4_col') : ?>
- <!-- Sidebar -->
- <?php echo rh_generate_incss('widgetfilters'); ?>
- <?php get_sidebar('shop'); ?>
- <!-- /Sidebar -->
- <?php endif; ?>
- <?php endif; ?>
- <?php endif; ?>
- <?php get_footer('shop'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement