Advertisement
piotrkorzan

woo

Mar 29th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.37 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 3.4.0
  10. */
  11.  
  12. if ( ! defined( 'ABSPATH' ) ) {
  13. exit; // Exit if accessed directly
  14. }
  15.  
  16. global $product, $woocommerce_loop;
  17.  
  18.  
  19. $options = _WSH()->option();
  20. $theme_options = (sh_set($options, 'shop_page_view') == 'four_column') ? ' style="width:24.33%"' : ' ';
  21. $column = (sh_set($options, 'shop_page_view') == 'four_column') ? '4' : '3';
  22.  
  23. // Store loop count we're currently on
  24. if ( empty( $woocommerce_loop['loop'] ) )
  25. $woocommerce_loop['loop'] = 0;
  26.  
  27. // Store column count for displaying the grid
  28. if ( empty( $woocommerce_loop['columns'] ) )
  29. $woocommerce_loop['columns'] = apply_filters( 'loop_shop_columns', $column );
  30.  
  31. // Ensure visibility
  32. if ( ! $product || ! $product->is_visible() )
  33. return;
  34.  
  35. // Increase loop count
  36. $woocommerce_loop['loop']++;
  37.  
  38. // Extra post classes
  39. $classes = array();
  40. if ( 0 == ( $woocommerce_loop['loop'] - 1 ) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns'] )
  41. $classes[] = 'first';
  42. if ( 0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns'] )
  43. $classes[] = 'last';
  44.  
  45. $classes[] = '';
  46.  
  47. $meta = _WSH()->get_meta();
  48.  
  49. ?>
  50. <li class="mix <?php echo implode(' ', $classes );?>" <?php echo $theme_options; ?>>
  51. <div class="clearfix"<?php //post_class( $classes ); ?>>
  52.  
  53. <?php //do_action( 'woocommerce_before_shop_loop_item' ); ?>
  54.  
  55. <div class="thumbnail thumbnail-product">
  56. <figure class="image-zoom">
  57. <?php the_post_thumbnail( '267x265' );?>
  58. </figure>
  59. <div class="caption">
  60. <div class="text-wrap">
  61. <h5><a href="<?php the_permalink(); ?>">
  62.  
  63. <?php
  64. /**
  65. * woocommerce_before_shop_loop_item_title hook
  66. *
  67. * @hooked woocommerce_show_product_loop_sale_flash - 10
  68. * @hooked woocommerce_template_loop_product_thumbnail - 10
  69. */
  70. do_action( 'woocommerce_before_shop_loop_item_title' );
  71. ?>
  72. <?php the_title();?>
  73. </a></h5>
  74.  
  75. <div class="rating-star">
  76. <?php woocommerce_template_loop_rating(); ?>
  77. </div>
  78.  
  79. <p class="prod-price text-primary"><?php esc_html_e('Cena ', 'perfume'); ?><?php woocommerce_template_loop_price(); ?></p>
  80. <div class="filter-list-disp">
  81. <p class="dispatch-info"><i class="flaticon-shipping"></i> <?php echo sh_set($meta, 'time-duratn'); ?></p>
  82. <a href="<?php the_permalink(); ?>" class="btn btn-default view-detail"><?php esc_html_e('View Details', 'perfume'); ?></a>
  83. </div>
  84. </div>
  85.  
  86. <?php $product_data = sh_set( $meta, 'product-data' );
  87. $explode = ($product_data ) ? explode("\n", $product_data) : array();
  88.  
  89. if( $explode ) :?>
  90. <div class="list-wrap">
  91. <h5><?php echo esc_html_e('Highlights:', 'perfume'); ?></h5>
  92. <ul class="list-6">
  93. <?php foreach( $explode as $ex ): ?>
  94. <li><?php echo balanceTags( $ex ); ?></li>
  95. <?php endforeach; ?>
  96. </ul>
  97. <a href="<?php the_permalink(); ?>" class="btn btn-default view-detail"><?php esc_html_e('View Details', 'perfume'); ?></a>
  98. </div><!-- /list-wrap -->
  99. <?php endif; ?>
  100. </div>
  101.  
  102. <?php
  103.  
  104. /**
  105. * woocommerce_after_shop_loop_item hook
  106. *
  107. * @hooked woocommerce_template_loop_add_to_cart - 10
  108. */
  109. do_action( 'woocommerce_after_shop_loop_item' );
  110.  
  111. ?>
  112. </div>
  113. </div>
  114. </li>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement