Lew1s
June 14, 2017, 12:32pm
1
Hey, using sage 8 and trying to customize category page which is at archive-product.php.
The problem is some hook with sage and cant sort out.
This is my shop page: http://prntscr.com/fjnktn
This is my category page which I would like to be same to shop page: http://prntscr.com/fjoszm
Cant find in sage how to customize category page to have sidebar and same layout like my base-template-shop.php.
thanks for help.
ben
June 14, 2017, 1:58pm
2
You posted the same screenshot. Not sure what you’re looking for here?
What is the problem?[quote=“Lew1s, post:1, topic:9805”]
Cant find in sage how to customize category page to have sidebar and same layout like my base-template-shop.php
[/quote]
What have you tried so far?
Lew1s
June 14, 2017, 2:01pm
3
sorry here is the category page without sidebar. http://prntscr.com/fjoszm
I tried to customize arhive-product.php in theme/woocommerce. But there are just hooks and dont know where I can customize with Sage to look same as my shop page which is from template-shop.php
ben
June 14, 2017, 3:25pm
4
But what have you tried so far?
Have you read the WooCommerce topics on here? Have you looked at the WooCommerce blog post on the Roots site?
Lew1s
June 14, 2017, 3:27pm
5
Yes I did both but cant see anything where to customize products category page. I added
<?php get_template_part('templates/page', 'header'); ?>
into archive-product.php but I am getting just header. Looking into here https://roots.io/using-woocommerce-with-sage/
Lew1s
June 15, 2017, 8:21am
6
archive-product.php
get_template_part('templates/page', 'header'); ?>
<?php
/**
* woocommerce_before_main_content hook.
*
* @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
* @hooked woocommerce_breadcrumb - 20
* @hooked WC_Structured_Data::generate_website_data() - 30
*/
do_action( 'woocommerce_before_main_content' );
?>
<header class="woocommerce-products-header">
<?php if ( apply_filters( 'woocommerce_show_page_title', true ) ) : ?>
<h1 class="woocommerce-products-header__title page-title"><?php woocommerce_page_title(); ?></h1>
<?php endif; ?>
<?php
/**
* woocommerce_archive_description hook.
*
* @hooked woocommerce_taxonomy_archive_description - 10
* @hooked woocommerce_product_archive_description - 10
*/
do_action( 'woocommerce_archive_description' );
?>
</header>
<?php if ( have_posts() ) : ?>
<?php
/**
* woocommerce_before_shop_loop hook.
*
* @hooked wc_print_notices - 10
* @hooked woocommerce_result_count - 20
* @hooked woocommerce_catalog_ordering - 30
*/
do_action( 'woocommerce_before_shop_loop' );
?>
<?php woocommerce_product_loop_start(); ?>
<?php woocommerce_product_subcategories(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/**
* woocommerce_shop_loop hook.
*
* @hooked WC_Structured_Data::generate_product_data() - 10
*/
do_action( 'woocommerce_shop_loop' );
?>
<?php wc_get_template_part( 'content', 'product' ); ?>
<?php endwhile; // end of the loop. ?>
<?php woocommerce_product_loop_end(); ?>
<?php
/**
* woocommerce_after_shop_loop hook.
*
* @hooked woocommerce_pagination - 10
*/
do_action( 'woocommerce_after_shop_loop' );
?>
<?php elseif ( ! woocommerce_product_subcategories( array( 'before' => woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) : ?>
<?php
/**
* woocommerce_no_products_found hook.
*
* @hooked wc_no_products_found - 10
*/
do_action( 'woocommerce_no_products_found' );
?>
<?php endif; ?>
<?php
/**
* woocommerce_after_main_content hook.
*
* @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
*/
do_action( 'woocommerce_after_main_content' );
?>
<?php
/**
* woocommerce_sidebar hook.
*
* @hooked woocommerce_get_sidebar - 10
*/
do_action( 'woocommerce_sidebar' );
?>
<?php get_footer( 'shop' ); ?>
my template-shop.php
<?php
/**
* Template Name: Custom Shop
*/
?>
<?php while (have_posts()) : the_post(); ?>
<div class="container">
<?php get_template_part('templates/content', 'page'); ?>
<section class="nase-vina-obchod-page">
<div class="row">
<?php
$args = array(
'post_type' => 'product',
'stock' => 1,
'posts_per_page' => 120,
'orderby' =>'date',
'order' => 'DESC' );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-6 col-xl-6 product-box">
<div class="row">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 col-xl-3 width-25">
<a id="id-<?php the_id(); ?>" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php the_post_thumbnail( 'shop_thumbnail' ); ?> </a>
</div><!-- /col-lg-3 -->
<div class="col-xs-9 col-sm-9 col-md-9 col-lg-9 col-xl-9 width-75 text-left product-content">
<h4><?php the_title(); ?></h4>
<div class="product-text">
<?php
$excerpt = get_the_excerpt();
$excerpt = substr( $excerpt , 0, 250);
echo $excerpt;
?>...
</div>
<a class="btn btn-yellow-vines" id="id-<?php the_id(); ?>" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Viac</a>
</div><!-- /col-lg-3 -->
</div>
</div>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
</div>
</section>
</div>
<?php endwhile; ?>
I am trying to customize archive-product.php to same layout like my shop template. http://prntscr.com/fjzrv6
I really tried everything.