Advertisement
Konark

Untitled

May 26th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. <?php
  2. /**
  3. * The template for displaying product content within loops
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/content-product.php.
  6. *
  7. * HOWEVER, on occasion WooCommerce will need to update template files and you
  8. * (the theme developer) will need to copy the new files to your theme to
  9. * maintain compatibility. We try to do this as little as possible, but it does
  10. * happen. When this occurs the version of the template file will be bumped and
  11. * the readme will list any important changes.
  12. *
  13. * @see https://docs.woocommerce.com/document/template-structure/
  14. * @author WooThemes
  15. * @package WooCommerce/Templates
  16. * @version 3.0.0
  17. */
  18.  
  19. if ( ! defined( 'ABSPATH' ) ) {
  20. exit; // Exit if accessed directly
  21. }
  22.  
  23. global $product;
  24.  
  25. // Ensure visibility
  26. if ( empty( $product ) || ! $product->is_visible() ) {
  27. return;
  28. }
  29. ?>
  30. <li <?php post_class(); ?>>
  31. <?php
  32. /**
  33. * woocommerce_before_shop_loop_item_title hook.
  34. *
  35. * @hooked woocommerce_show_product_loop_sale_flash - 10
  36. * @hooked woocommerce_template_loop_product_thumbnail - 10
  37. */
  38. do_action( 'woocommerce_before_shop_loop_item_title' );
  39.  
  40.  
  41.  
  42. /**
  43. * woocommerce_before_shop_loop_item hook.
  44. *
  45. * @hooked woocommerce_template_loop_product_link_open - 10
  46. */
  47. do_action( 'woocommerce_before_shop_loop_item' );
  48.  
  49. woocommerce_template_loop_rating();
  50.  
  51. /**
  52. * woocommerce_shop_loop_item_title hook.
  53. *
  54. * @hooked woocommerce_template_loop_product_title - 10
  55. */
  56. do_action( 'woocommerce_shop_loop_item_title' );
  57. echo wc_get_product_category_list( $product->get_id(), ', ', '<span class="posted_in">' . _n( 'Category:', 'Categories:', count( $product->get_category_ids() ), 'woocommerce' ) . ' ', '</span>' );
  58.  
  59. /**
  60. * woocommerce_after_shop_loop_item_title hook.
  61. *
  62. * @hooked woocommerce_template_loop_rating - 5
  63. * @hooked woocommerce_template_loop_price - 10
  64. */
  65. remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5);
  66. do_action( 'woocommerce_after_shop_loop_item_title' );
  67.  
  68.  
  69. /**
  70. * woocommerce_after_shop_loop_item hook.
  71. *
  72. * @hooked woocommerce_template_loop_product_link_close - 5
  73. * @hooked woocommerce_template_loop_add_to_cart - 10
  74. */
  75. do_action( 'woocommerce_after_shop_loop_item' );
  76. ?>
  77. </li>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement