woocommerce/templates/content-widget-product.php

44 lines
1.3 KiB
PHP
Raw Normal View History

<?php
/**
2017-10-27 14:35:34 +00:00
* The template for displaying product widget entries.
*
2015-11-03 13:31:20 +00:00
* This template can be overridden by copying it to yourtheme/woocommerce/content-widget-product.php.
2016-02-12 11:28:41 +00:00
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates
* @version 3.5.2
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
2017-10-27 14:35:34 +00:00
global $product;
if ( ! is_a( $product, 'WC_Product' ) ) {
return;
}
2017-10-27 14:35:34 +00:00
?>
<li>
2017-10-27 14:35:34 +00:00
<?php do_action( 'woocommerce_widget_product_item_start', $args ); ?>
<a href="<?php echo esc_url( $product->get_permalink() ); ?>">
<?php echo $product->get_image(); ?>
<span class="product-title"><?php echo wp_kses_post( $product->get_name() ); ?></span>
2017-10-27 14:35:34 +00:00
</a>
<?php if ( ! empty( $show_rating ) ) : ?>
2018-07-24 13:50:19 +00:00
<?php echo wp_kses_post( wc_get_rating_html( $product->get_average_rating() ) ); ?>
<?php endif; ?>
2017-10-27 14:35:34 +00:00
<?php echo $product->get_price_html(); ?>
2017-10-27 14:35:34 +00:00
<?php do_action( 'woocommerce_widget_product_item_end', $args ); ?>
</li>