auth
5 years ago
cart
3 years ago
checkout
3 years ago
emails
4 years ago
global
4 years ago
loop
5 years ago
myaccount
3 years ago
notices
5 years ago
order
4 years ago
single-product
3 years ago
archive-product.php
5 years ago
content-product-cat.php
5 years ago
content-product.php
5 years ago
content-single-product.php
5 years ago
content-widget-price-filter.php
3 years ago
content-widget-product.php
5 years ago
content-widget-reviews.php
5 years ago
product-searchform.php
5 years ago
single-product-reviews.php
5 years ago
single-product.php
5 years ago
taxonomy-product-cat.php
5 years ago
taxonomy-product-tag.php
5 years ago
content-widget-product.php
44 lines
| 1 | <?php |
| 2 | /** |
| 3 | * The template for displaying product widget entries. |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/content-widget-product.php. |
| 6 | * HOWEVER, on occasion WooCommerce will need to update template files and you |
| 7 | * (the theme developer) will need to copy the new files to your theme to |
| 8 | * maintain compatibility. We try to do this as little as possible, but it does |
| 9 | * happen. When this occurs the version of the template file will be bumped and |
| 10 | * the readme will list any important changes. |
| 11 | * |
| 12 | * @see https://docs.woocommerce.com/document/template-structure/ |
| 13 | * @package WooCommerce\Templates |
| 14 | * @version 3.5.5 |
| 15 | */ |
| 16 | |
| 17 | if ( ! defined( 'ABSPATH' ) ) { |
| 18 | exit; |
| 19 | } |
| 20 | |
| 21 | global $product; |
| 22 | |
| 23 | if ( ! is_a( $product, 'WC_Product' ) ) { |
| 24 | return; |
| 25 | } |
| 26 | |
| 27 | ?> |
| 28 | <li> |
| 29 | <?php do_action( 'woocommerce_widget_product_item_start', $args ); ?> |
| 30 | |
| 31 | <a href="<?php echo esc_url( $product->get_permalink() ); ?>"> |
| 32 | <?php echo $product->get_image(); // PHPCS:Ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 33 | <span class="product-title"><?php echo wp_kses_post( $product->get_name() ); ?></span> |
| 34 | </a> |
| 35 | |
| 36 | <?php if ( ! empty( $show_rating ) ) : ?> |
| 37 | <?php echo wc_get_rating_html( $product->get_average_rating() ); // PHPCS:Ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 38 | <?php endif; ?> |
| 39 | |
| 40 | <?php echo $product->get_price_html(); // PHPCS:Ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 41 | |
| 42 | <?php do_action( 'woocommerce_widget_product_item_end', $args ); ?> |
| 43 | </li> |
| 44 |