PageRenderTime 49ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/loop-on_sale.php

https://github.com/scottpoulin/jigoshop
PHP | 71 lines | 30 code | 26 blank | 15 comment | 7 complexity | 8ab210d70f3b39ca61a478ad9ee72dfd MD5 | raw file
Possible License(s): GPL-3.0
  1. <?php
  2. /**
  3. * Loop shop template
  4. *
  5. * DISCLAIMER
  6. *
  7. * Do not edit or add directly to this file if you wish to upgrade Jigoshop to newer
  8. * versions in the future. If you wish to customise Jigoshop core for your needs,
  9. * please use our GitHub repository to publish essential changes for consideration.
  10. *
  11. * @package Jigoshop
  12. * @category Catalog
  13. * @author Jigoshop
  14. * @copyright Copyright Š 2011-2013 Jigoshop.
  15. * @license http://jigoshop.com/license/commercial-edition
  16. */
  17. ?>
  18. <?php
  19. global $columns, $per_page, $jigoshop_sale_products, $post;
  20. ob_start();
  21. do_action('jigoshop_before_shop_loop');
  22. $loop = 0;
  23. if (!isset($columns) || !$columns) $columns = apply_filters('loop_shop_columns', 4);
  24. foreach ( $jigoshop_sale_products as $post ) :
  25. setup_postdata( $post );
  26. $_product = new jigoshop_product( $post->ID ); $loop++;
  27. ?>
  28. <li class="product <?php if ($loop%$columns==0) echo 'last'; if (($loop-1)%$columns==0) echo 'first'; ?>">
  29. <?php do_action('jigoshop_before_shop_loop_item'); ?>
  30. <a href="<?php the_permalink(); ?>">
  31. <?php do_action('jigoshop_before_shop_loop_item_title', $post, $_product); ?>
  32. <strong><?php the_title(); ?></strong>
  33. <?php do_action('jigoshop_after_shop_loop_item_title', $post, $_product); ?>
  34. </a>
  35. <?php do_action('jigoshop_after_shop_loop_item', $post, $_product); ?>
  36. </li><?php
  37. if ($loop==$per_page) break;
  38. endforeach;
  39. if ($loop==0) :
  40. echo '<p class="info">'.__('No products found which match your selection.', 'jigoshop').'</p>';
  41. else :
  42. $found_posts = ob_get_clean();
  43. echo '<ul class="products">' . $found_posts . '</ul><div class="clear"></div>';
  44. endif;
  45. do_action('jigoshop_after_shop_loop');