| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template: Product Card Content. |
| 4 |
* |
| 5 |
* This template can be overridden by copying it to yourtheme/orderable/card-content.php |
| 6 |
* |
| 7 |
* HOWEVER, on occasion Orderable 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 |
* @package Orderable/Templates |
| 14 |
* |
| 15 |
* @var WC_Product_Variable $product Product. |
| 16 |
*/ |
| 17 |
|
| 18 |
defined( 'ABSPATH' ) || exit; |
| 19 |
|
| 20 |
/** |
| 21 |
* Filter the product short description to show in the card. |
| 22 |
* |
| 23 |
* @since 1.1.0 |
| 24 |
* @hook orderable_short_description |
| 25 |
* @param string $short_description The product short description. |
| 26 |
* @param WC_Product $product The product. |
| 27 |
* @return string New value |
| 28 |
*/ |
| 29 |
$short_description = apply_filters( 'orderable_short_description', $product->get_short_description(), $product ); |
| 30 |
?> |
| 31 |
|
| 32 |
<div class="orderable-product__content"> |
| 33 |
|
| 34 |
<?php |
| 35 |
/** |
| 36 |
* Fires before product title in the product card. |
| 37 |
* |
| 38 |
* @since 1.7.0 |
| 39 |
* @hook orderable_before_product_title |
| 40 |
* @param WC_Product $product The product. |
| 41 |
* @param array $args Layout settings. |
| 42 |
*/ |
| 43 |
do_action( 'orderable_before_product_title', $product, $args ); |
| 44 |
?> |
| 45 |
|
| 46 |
<h2 class="orderable-product__title"><?php echo esc_html( $product->get_name() ); ?></h2> |
| 47 |
|
| 48 |
<?php |
| 49 |
/** |
| 50 |
* Fires before product description in the product card. |
| 51 |
* |
| 52 |
* @since 1.7.0 |
| 53 |
* @hook orderable_before_product_description |
| 54 |
* @param WC_Product $product The product. |
| 55 |
* @param array $args Layout settings. |
| 56 |
*/ |
| 57 |
do_action( 'orderable_before_product_description', $product, $args ); |
| 58 |
?> |
| 59 |
|
| 60 |
<?php if ( ! empty( $short_description ) && ' ' !== $short_description ) { ?> |
| 61 |
<p class="orderable-product__description"><?php echo wp_kses_post( $short_description ); ?></p> |
| 62 |
<?php } ?> |
| 63 |
</div> |
| 64 |
|