PluginProbe
Orderable – Restaurant & Food Ordering System / 1.19.0
Orderable – Restaurant & Food Ordering System v1.19.0
0.1.4 0.1.5 0.2.0 1.0.0 1.1.0 1.1.1 1.10.0 1.10.1 1.11.0 1.12.0 1.12.1 1.12.2 1.13.0 1.14.0 1.15.0 1.16.0 1.17.0 1.17.1 1.18.0 1.19.0 1.19.1 1.19.2 1.2.0 1.20.0 1.20.1 All 44 releases
orderable / templates / product / hero.php

hero.php in Orderable – Restaurant & Food Ordering System 1.19.0, at templates/product/hero.php

59 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template: Product Hero.
4 *
5 * This template can be overridden by copying it to yourtheme/orderable/hero.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 * @var array $args Array of args for the shortcode.
17 */
18
19 defined( 'ABSPATH' ) || exit;
20
21 if ( ! $args['images'] ) {
22 return;
23 }
24 ?>
25
26 <div class="orderable-product__hero">
27 <?php do_action( 'orderable_before_product_hero', $product, $args ); ?>
28
29 <?php
30 /**
31 * Allow product hero image size to be updated.
32 *
33 * @param WC_Product $product Product.
34 * @param array $args Argumentss passed to the Layout shortcode.
35 * @since 1.6.0
36 */
37 $orderable_product_hero_image_size = apply_filters( 'orderable_product_hero_image_size', 'woocommerce_thumbnail', $product, $args );
38
39 $srcset = false;
40
41 $product_image_2x = Orderable_Helpers::get_product_image_2x( $product, $orderable_product_hero_image_size );
42
43 if ( $product_image_2x ) {
44 $srcset = $product_image_2x['src'] . ' 2x';
45 }
46
47 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
48 echo $product->get_image(
49 $orderable_product_hero_image_size,
50 [
51 'class' => 'orderable-product__image',
52 'srcset' => esc_attr( $srcset ),
53 ]
54 );
55 ?>
56
57 <?php do_action( 'orderable_after_product_hero', $product, $args ); ?>
58 </div>
59