PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.0.2
ShopBuilder – WooCommerce Builder For Elementor v2.0.2
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / templates / elementor / general / grid / grid-layout2.php

grid-layout2.php in ShopBuilder – WooCommerce Builder For Elementor 2.0.2, at templates/elementor/general/grid/grid-layout2.php

194 lines 4.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template: Grid Layout 2.
4 *
5 * @package RadiusTheme\SB
6 */
7
8 /**
9 * Template variables:
10 *
11 * @var $grid string
12 * @var $class string
13 * @var $p_id int
14 * @var $img_args array
15 * @var $p_link string
16 * @var $items array
17 * @var $add_to_cart string
18 * @var $title_tag string
19 * @var $hover_btn_text string
20 * @var $excerpt_limit string
21 * @var $excerpt string
22 * @var $title_class string
23 * @var $title_link bool
24 * @var $title string
25 * @var $badge_class string
26 * @var $action_btn_preset string
27 * @var $action_btn_position string
28 * @var $swatch_position string
29 * @var $swatch_type string
30 * @var $has_attributes bool
31 * @var $raw_settings array
32 */
33
34 use RadiusTheme\SB\Helpers\Fns;
35
36 // Do not allow directly accessing this file.
37 if ( ! defined( 'ABSPATH' ) ) {
38 exit( 'This script cannot be accessed directly.' );
39 }
40
41 global $product;
42
43 $classes = esc_attr( $grid ) . ' ' . esc_attr( $class );
44 $swatch_title_class = $has_attributes && in_array( 'swatches', $items, true ) && 'title' === $swatch_position ? ' title-with-swatch' : '';
45 $swatch_price_class = $has_attributes && in_array( 'swatches', $items, true ) && 'price' === $swatch_position ? ' price-with-swatch' : '';
46 ?>
47
48 <div <?php wc_product_class( $classes, $product ); ?> data-id="<?php echo absint( $p_id ); ?>">
49 <?php
50 /**
51 * Before product items hook.
52 */
53 do_action( 'rtsb/before/shop/product/item' );
54 ?>
55
56 <div class="rtsb-grid-item">
57 <div class="rtsb-product-img">
58 <?php
59 /**
60 * Before product image hook.
61 */
62 do_action( 'rtsb/before/shop/product/image' );
63
64 /**
65 * Product image hook.
66 *
67 * @hooked RadiusTheme\SB\Controllers\Hooks\ActionHooks::render_image 10
68 */
69 do_action( 'rtsb/shop/product/image', $img_args, $raw_settings );
70
71 /**
72 * Sale Badge.
73 */
74 if ( ! empty( $p_sale ) ) {
75 ?>
76 <div class="rtsb-promotion">
77 <?php
78 Fns::get_badge_html( $p_sale, $badge_class );
79 ?>
80 </div>
81 <?php
82 }
83
84 /**
85 * Action buttons above image.
86 */
87 Fns::print_html( Fns::get_formatted_action_buttons( $items, $add_to_cart, $action_btn_preset, $action_btn_position, 'top' ) );
88
89 /**
90 * After product image hook.
91 */
92 do_action( 'rtsb/after/shop/product/image', $raw_settings );
93 ?>
94 </div><!-- .rtsb-product-img -->
95
96 <div class="rtsb-product-content">
97 <?php
98 /**
99 * Before product content hook.
100 */
101 do_action( 'rtsb/before/shop/product/content' );
102
103 /**
104 * Product Rating.
105 */
106 if ( in_array( 'rating', $items, true ) ) {
107 Fns::get_product_rating_html();
108 }
109
110 /**
111 * Product Price.
112 */
113 if ( in_array( 'price', $items, true ) ) {
114 ?>
115 <div class="product-price<?php echo esc_attr( $swatch_price_class ); ?>">
116 <div class="price-wrapper">
117 <?php
118 woocommerce_template_single_price();
119 ?>
120 </div>
121 <?php
122 if ( in_array( 'swatches', $items, true ) && 'price' === $swatch_position ) {
123 Fns::get_product_swatches( $swatch_type );
124 }
125 ?>
126 </div>
127 <?php
128 }
129
130 /**
131 * Before product title hook.
132 */
133 do_action( 'rtsb/before/shop/product/title' );
134
135 /**
136 * After product title hook.
137 */
138 do_action( 'rtsb/after/shop/product/title' );
139
140 /**
141 * Action buttons after content.
142 */
143 Fns::print_html( Fns::get_formatted_action_buttons( $items, $add_to_cart, $action_btn_preset, $action_btn_position, 'bottom' ) );
144
145 /**
146 * After product content hook.
147 */
148 do_action( 'rtsb/after/shop/product/content', $raw_settings );
149
150 /**
151 * Product Title.
152 */
153 if ( in_array( 'title', $items, true ) ) {
154 ?>
155 <div class="product-title-with-btn">
156 <div class="rtsb-product-title-wrapper <?php echo esc_attr( $swatch_title_class ); ?>">
157 <<?php echo esc_attr( $title_tag ); ?> class="<?php echo esc_attr( $title_class ); ?>">
158 <?php
159 if ( $title_link ) {
160 ?>
161 <a class="woocommerce-LoopProduct-link" href="<?php echo esc_url( $p_link ); ?>"><?php Fns::print_html( $title ); ?></a>
162 <?php
163 } else {
164 Fns::print_html( $title );
165 }
166 ?>
167 </<?php echo esc_attr( $title_tag ); ?>>
168 </div>
169 <div class="btn-wrap">
170 <a class="woocommerce-LoopProduct-link rtsb-text-btn" href="<?php echo esc_url( $p_link ); ?>">
171 <span class="text"><?php echo esc_html( $hover_btn_text ); ?></span>
172
173 <?php
174 if ( ! empty( $hover_btn_icon ) ) {
175 Fns::print_html( $hover_btn_icon, true );
176 }
177 ?>
178 </a>
179 </div>
180 </div>
181 <?php
182 }
183 ?>
184 </div><!-- .rtsb-product-content -->
185 </div><!-- .rtsb-grid-item -->
186
187 <?php
188 /**
189 * After product item hook.
190 */
191 do_action( 'rtsb/after/shop/product/item' );
192 ?>
193 </div><!-- .rtsb-product -->
194