Advertisement
raselahmed7

ElementorWoo | Class #7 | content-product.php

Feb 27th, 2019
585
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.41 KB | None | 0 0
  1. <?php
  2. defined( 'ABSPATH' ) || exit;
  3.  
  4. global $product;
  5.  
  6. // Ensure visibility.
  7. if ( empty( $product ) || ! $product->is_visible() ) {
  8.     return;
  9. }
  10. ?>
  11. <li <?php wc_product_class(); ?>>
  12.     <div class="product-bg" style="background-image:url(<?php echo get_the_post_thumbnail_url(get_the_ID(), 'medium'); ?>)">
  13.         <div class="row text-center">
  14.             <div class="col my-auto">
  15.                 <div class="product-buttons">
  16.                     <!-- Add to cart Button -->
  17.                     <a href="<?php echo site_url(); ?>/?add-to-cart=<?php echo get_the_ID(); ?>" data-quantity="1" class="product_type_simple add_to_cart_button ajax_add_to_cart" data-product_id="<?php echo get_the_ID(); ?>"><i class="fa fa-shopping-cart"></i></a>
  18.  
  19.                     <?php if(function_exists('yith_wishlist_constructor')) : ?>
  20.                     <!-- Add to wishlist Button -->
  21.                     <?php echo do_shortcode('[yith_wcwl_add_to_wishlist]'); ?>
  22.                     <?php endif; ?>
  23.  
  24.                     <?php if(function_exists('yith_woocompare_constructor')) : ?>
  25.                     <!-- Add to compare Button -->
  26.                     <a class="compare" data-product_id="<?php echo get_the_ID(); ?>" href="<?php echo site_url(); ?>/?action=yith-woocompare-add-product&amp;id=<?php echo get_the_ID(); ?>"></a>
  27.                     <?php endif; ?>
  28.                 </div>
  29.                
  30.                 <?php woocommerce_template_loop_rating(); ?>
  31.             </div>
  32.         </div>
  33.     </div>
  34.     <a href="<?php the_permalink(); ?>"><?php do_action('woocommerce_shop_loop_item_title'); ?></a>
  35.     <?php woocommerce_template_loop_price(); ?>
  36. </li>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement