lightspeeddevelopment /
lsx
| 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 | // Exit if accessed directly. |
||
| 18 | if ( ! defined( 'ABSPATH' ) ) { |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 19 | exit; |
||
| 20 | } |
||
| 21 | |||
| 22 | global $product; |
||
| 23 | |||
| 24 | if ( ! is_a( $product, 'WC_Product' ) ) { |
||
|
0 ignored issues
–
show
|
|||
| 25 | return; |
||
| 26 | } ?> |
||
| 27 | |||
| 28 | <div class="lsx-woocommerce-slot"> |
||
| 29 | <a href="<?php echo esc_url( $product->get_permalink() ); ?>"> |
||
| 30 | <figure class="lsx-woocommerce-avatar"> |
||
| 31 | <?php echo wp_kses_post( $product->get_image( 'lsx-thumbnail-square' ) ); ?> |
||
| 32 | </figure> |
||
| 33 | </a> |
||
| 34 | |||
| 35 | <h5 class="lsx-woocommerce-title"> |
||
| 36 | <a href="<?php echo esc_url( $product->get_permalink() ); ?>"><?php echo wp_kses_post( $product->get_name() ); ?></a> |
||
| 37 | </h5> |
||
| 38 | |||
| 39 | <?php if ( ! empty( $show_rating ) ) : ?> |
||
|
0 ignored issues
–
show
|
|||
| 40 | <div class="lsx-woocommerce-rating"> |
||
| 41 | <?php echo wp_kses_post( wc_get_rating_html( $product->get_average_rating() ) ); ?> |
||
| 42 | </div> |
||
| 43 | <?php endif; ?> |
||
| 44 | |||
| 45 | <?php |
||
| 46 | $price_html = $product->get_price_html(); |
||
| 47 | if ( $price_html ) : ?> |
||
|
0 ignored issues
–
show
|
|||
| 48 | <div class="lsx-woocommerce-price"> |
||
| 49 | <?php echo wp_kses_post( $price_html ); ?> |
||
| 50 | </div> |
||
| 51 | <?php endif; ?> |
||
| 52 | |||
| 53 | <div class="lsx-woocommerce-content"> |
||
| 54 | <a href="<?php echo esc_url( $product->get_permalink() ); ?>" class="moretag"><?php esc_html_e( 'View more', 'lsx' ); ?></a> |
||
| 55 | </div> |
||
| 56 | </div> |
||
| 57 |