PATH:
home
/
lab2454c
/
isaaclondston.com
/
wp-content
/
themes
/
divine_saint
/
woocommerce
<?php /** * The Template for displaying products in a product category. Simply includes the archive template * * This template can be overridden by copying it to yourtheme/woocommerce/taxonomy-product-cat.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://docs.woocommerce.com/document/template-structure/ * @package WooCommerce\Templates * @version 4.7.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } get_header(); ?> <div class="header__banner__main header__banner__inner header__banner__contact"> <div class="banner__content"> <div class="container"> <div class="banner__container__inner__noimage"> <h1><?php woocommerce_page_title(); ?></h1> </div> </div> </div> </div> <div class="body__container__wrapp body__container__inner"> <div class="product__wrapp"> <div class="tab__wrapp"> <ul> <?php $args = array( 'taxonomy' => 'product_cat', 'hide_empty' => true, ); $product_cat = get_terms( $args ); foreach ($product_cat as $parent_product_cat) { if (!empty($parent_product_cat)){ $thumbnail_id = get_term_meta( $parent_product_cat->term_id, 'thumbnail_id', true ); $image = wp_get_attachment_url( $thumbnail_id ); ?> <li> <a href="<?= get_term_link($parent_product_cat->term_id) ?>"> <div class="image__box"> <img src="<?= $image ?>" alt="" /> </div> <h3><?= $parent_product_cat->name ?></h3> </a> </li> <?php } } ?> </ul> </div> <div class="product__list__wrapp"> <div class="container-xl container-lg container-fluid"> <div class="row"> <div class="col-xl-3 col-lg-3 col-md-3"> <div class="category__sidebar"> <h2>Categories</h2> <ul> <?php $args = array( 'taxonomy' => 'product_cat', 'hide_empty' => true, ); $product_cat = get_terms( $args ); foreach ($product_cat as $parent_product_cat) { if (!empty($parent_product_cat)){ ?> <li><a href="<?= get_term_link($parent_product_cat->term_id) ?>"><?= $parent_product_cat->name ?></a></li> <?php } } ?> </ul> </div> </div> <div class="col-xl-9 col-lg-9 col-md-9"> <div class="product__list__main"> <ul> <?php $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $args = array( 'post_type' => 'product', 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => 12, 'paged' => $paged, 'tax_query' => array( array( 'taxonomy' => 'product_cat', 'field' => 'slug', // Or 'term_id' or 'name' 'terms' => get_query_var( 'product_cat' ), // A slug term // 'include_children' => false // or true (optional) )), 'orderby' => 'DESC' ); $products = new WP_Query( $args ); if ( $products->have_posts() ) : while ( $products->have_posts() ) : $products->the_post(); ?> <li class="product__item"> <div class="thumb__wrapper"> <a href="<?php the_permalink(); ?>"> <div class="image__box"> <?php if (has_post_thumbnail( $products->post->ID )) echo get_the_post_thumbnail($products->post->ID, 'shop_catalog'); else echo '<img src="'.woocommerce_placeholder_img_src().'" alt="Placeholder" />'; ?> </div> </a> <?php $terms = get_the_terms( $products->ID, 'product_cat' ); if ( ! empty( $terms ) ) { foreach ( $terms as $term ) { ?> <span class="prod__cat__list"><?php echo $term->name; ?></span> <?php } } ?> <a href="<?php the_permalink(); ?>" class="loop__product__link"> <h3 class="product__title"><?php the_title(); ?></h3> <?php if ($average = $product->get_average_rating()) : ?> <?php echo '<div class="star-rating" title="'.sprintf(__( 'Rated %s out of 5', 'woocommerce' ), $average).'"><span style="width:'.( ( $average / 5 ) * 100 ) . '%"><strong itemprop="ratingValue" class="rating">'.$average.'</strong> '.__( 'out of 5', 'woocommerce' ).'</span></div>'; ?> <?php endif; ?> <span class="price"><?php echo $product->get_price_html(); ?></span> </a> </div> <div class="buttons__wrapper"> <a href="<?php the_permalink(); ?>"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 357.4 172.2" style="enable-background:new 0 0 357.4 172.2;" xml:space="preserve"> <path d="M353.8,77.6c-0.1-0.1-0.1-0.1-0.2-0.1c0-0.1-0.1-0.1-0.1-0.2L279.8,3.6c-4.8-4.8-12.6-4.8-17.4,0c-4.8,4.8-4.8,12.6,0,17.4 l52.9,52.9h-303C5.5,73.8,0,79.3,0,86.1v0c0,6.8,5.5,12.3,12.3,12.3h303.3l-52.9,52.9c-4.8,4.8-4.8,12.6,0,17.4 c4.8,4.8,12.6,4.8,17.4,0l73.7-73.7C358.6,90.1,358.6,82.4,353.8,77.6z" /> </svg> </a> </div> </li> <?php endwhile; ?> <nav class="pagination"> <?php pagination_bar( $products ); ?> </nav> <?php wp_reset_query(); endif; ?> </ul> </div> </div> </div> </div> </div> </div> </div> <?php get_footer();
[+]
..
[+]
single-product
[-] archive-product.php
[edit]
[-] content-single-product.php
[edit]
[+]
checkout
[-] content-widget-reviews.php
[edit]
[+]
emails
[+]
auth
[-] product-searchform.php
[edit]
[-] content-widget-product.php
[edit]
[+]
loop
[+]
cart
[+]
global
[+]
myaccount
[-] content-product.php
[edit]
[-] single-product-reviews.php
[edit]
[-] content-widget-price-filter.php
[edit]
[-] content-product-cat.php
[edit]
[-] content-related.php
[edit]
[+]
notices
[+]
order
[-] taxonomy-product-tag.php
[edit]
[-] taxonomy-product-cat.php
[edit]
[-] single-product.php
[edit]