Advertisement
Guest User

Untitled

a guest
Nov 11th, 2015
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. <?php
  2. /**
  3. * The template for displaying product content within loops.
  4. *
  5. * Override this template by copying it to yourtheme/woocommerce/content-product.php
  6. *
  7. * @author WooThemes
  8. * @package WooCommerce/Templates
  9. * @version 2.4.0
  10. */
  11.  
  12. if ( ! defined( 'ABSPATH' ) ) {
  13. exit; // Exit if accessed directly
  14. }
  15.  
  16. global $product, $woocommerce_loop;
  17.  
  18. // Store loop count we're currently on
  19. if ( empty( $woocommerce_loop['loop'] ) ) {
  20. $woocommerce_loop['loop'] = 0;
  21. }
  22.  
  23. // Store column count for displaying the grid
  24. if ( empty( $woocommerce_loop['columns'] ) ) {
  25. $woocommerce_loop['columns'] = apply_filters( 'loop_shop_columns', 4 );
  26. }
  27.  
  28. // Ensure visibility
  29. if ( ! $product || ! $product->is_visible() ) {
  30. return;
  31. }
  32.  
  33. // Increase loop count
  34. $woocommerce_loop['loop']++;
  35.  
  36. // Extra post classes
  37. $classes = array();
  38. if ( 0 == ( $woocommerce_loop['loop'] - 1 ) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns'] ) {
  39. $classes[] = 'first';
  40. }
  41. if ( 0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns'] ) {
  42. $classes[] = 'last';
  43. }
  44. ?>
  45. <li <?php post_class( $classes ); ?>>
  46.  
  47. <?php do_action( 'woocommerce_before_shop_loop_item' ); ?>
  48.  
  49. <a href="<?php the_permalink(); ?>" class="product-images">
  50.  
  51. <?php
  52. /**
  53. * woocommerce_before_shop_loop_item_title hook
  54. *
  55. * @hooked woocommerce_show_product_loop_sale_flash - 10
  56. * @hooked woocommerce_template_loop_product_thumbnail - 10
  57. */
  58. do_action( 'woocommerce_before_shop_loop_item_title' );
  59. ?>
  60.  
  61. </a>
  62.  
  63. <div class="product-details">
  64.  
  65. <div class="product-details-container">
  66.  
  67. <?php
  68. /**
  69. * woocommerce_shop_loop_item_title hook
  70. *
  71. * @hooked woocommerce_template_loop_product_title - 10
  72. */
  73.  
  74. //we are not using this hook in Evolve Plus Theme, because the title produced is not a link,
  75. //we are using the following at line 79 <h3 class="product-title"><a...</a></h3>
  76. //do_action( 'woocommerce_shop_loop_item_title' );
  77. ?>
  78.  
  79. <h3 class="product-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
  80.  
  81. <div class="clearfix">
  82.  
  83. <?php
  84. /**
  85. * woocommerce_after_shop_loop_item_title hook
  86. *
  87. * @hooked woocommerce_template_loop_rating - 5
  88. * @hooked woocommerce_template_loop_price - 10
  89. */
  90. do_action( 'woocommerce_after_shop_loop_item_title' );
  91. ?>
  92.  
  93. </div>
  94.  
  95. </div>
  96.  
  97. </div>
  98.  
  99. <?php
  100.  
  101. /**
  102. * woocommerce_after_shop_loop_item hook
  103. *
  104. * @hooked woocommerce_template_loop_add_to_cart - 10
  105. */
  106. do_action( 'woocommerce_after_shop_loop_item' );
  107.  
  108. ?>
  109.  
  110. </li>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement