PATH:
home
/
lab2454c
/
gemition.com
/
wp-content
/
themes
/
igpma
/
woocommerce
<?php /** * The Template for displaying product archives, including the main shop page which is a post type archive * * This template can be overridden by copying it to yourtheme/woocommerce/archive-product.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 3.4.0 */ defined( 'ABSPATH' ) || exit; get_header(); ?> <div class="breadcrumbs__wrapp"> <div class="container"> <ul> <li><a href="<?php echo home_url(); ?>">Home</a></li> <li class="current"><?php woocommerce_page_title(); ?></a></li> </ul> </div> </div> <div class="body__container__wrapp body__container__wrapp__inner"> <div class="product__wrapp"> <div class="container-xl"> <div class="heading__wrapp"> <!-- <h2>Carbon Bars</h2> --> </div> <div class="product__filter"> <!-- <h3>Products filters:</h3> --> <form> <div class="filter__wrapp"> <?php dynamic_sidebar( 'product-filter-wc' ); /* $args = array( 'taxonomy' => 'product_cat', 'hide_empty' => true, ); $product_cat = get_terms( $args ); $i = 1; 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 ); ?> <div class="form__group"> <input type="checkbox" id="myCheck<?php echo $i; ?>"> <label for="myCheck<?php echo $i; ?>"><?= $parent_product_cat->name ?></label> </div> <?php } $i++; } */ ?> </div> </form> </div> <div class="product__list__main"> <ul> <?php $filter = $_REQUEST['filters']; if(!empty($filter)){ preg_match_all('!\d+!', $filter, $matches); } $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; if(isset($matches) && count($matches) > 0){ $args = array( 'post_type' => 'product', 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => -1, 'tax_query' => [ [ 'taxonomy' => 'product_cat', 'field' => 'term_id', 'terms' => $matches[0], 'operator' => 'IN' ] ], 'paged' => $paged ); }else{ $args = array( 'post_type' => 'product', 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => -1, 'taxonomy' => 'product_cat', 'paged' => $paged ); } $products = new WP_Query($args); if ($products->have_posts()) : while ($products->have_posts()) : $products->the_post(); ?> <li class="product__item mr__bottom"> <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> <a href="<?php the_permalink(); ?>" class="loop__product__link"> <h3 class="product__title"><?php the_title(); ?></h3> </a> <div class="product__descraption"> <?php the_excerpt(); ?> </div> <div class="button__wrapp"> <a href="<?php the_permalink(); ?>">See Details</a> </div> <div class="product__verient"> <?php $product_id = $products->post->ID; $product = wc_get_product($product_id); $variations = $product->get_available_variations(); $variation_spot_price = '0.00'; $i = 1; foreach ($variations as $variation) { // $variation = new WC_Product_Variation($variation['variation_id']); // $variationName = implode(" / ", $variation->get_variation_attributes()); // echo $variationName.'<br />'; $varient_name = ''; if (isset($variation['attributes']['attribute_pa_buy-for']) && $variation['attributes']['attribute_pa_buy-for'] != '') { $varient_name = ucwords(str_replace('-', ' ', $variation['attributes']['attribute_pa_buy-for'])); } if ($i == 1) { $variation_spot_price = $variation['wc_spot_price'] ?? '0.00'; } ?> <label> <input id="coomassie-color<?php echo $variation['variation_id']; ?>" value="<?php echo $variation['variation_id']; ?>" type="radio" name="radio-<?php echo $products->post->ID; ?>" <?php echo ($i == 1) ? 'checked' : ''; ?> data-sprice="$ <?php echo $variation['wc_spot_price'] ?? '0.00'; ?>" data-product="<?php echo $products->post->ID; ?>"/> <span><?php echo $varient_name; ?> <?php echo $variation['variation_description'] ?? ''; ?> </span> </label> <?php $i++; } ?> </div> <div class="product__wrapp__bottom"> <div class="product__quantity"> <input data-min="10" data-max="0" type="text" name="quantity" value="10" placeholder="Enter qty"> <div class="quantity__selectors__container"> <div class="quantity__selectors"> <button type="button" class="increment__quantity" aria-label="Add one" data-direction="1"><span>+</span></button> <button type="button" class="decrement__quantity" aria-label="Subtract one" data-direction="-1"><span>−</span></button> </div> </div> </div> <a href="#" data-product="<?php echo $products->post->ID; ?>">Trade Now </a> <div class="price__wrapp price__wrapp__spot__price"><span>GEM STABLE PRICE</span> <div class="spot__price spot__price__<?php echo $products->post->ID; ?>">$ <?php echo $variation_spot_price;?></div> </div> </div> </div> </li> <?php endwhile; endif; wp_reset_query(); ?> </ul> </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]
[+]
notices
[+]
order
[-] taxonomy-product-tag.php
[edit]
[-] taxonomy-product-cat.php
[edit]
[-] single-product.php
[edit]