PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.1.0
ShopBuilder – WooCommerce Builder For Elementor v3.1.0
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
← All changes | app/Abstracts/AdditionalQueryCustomLayout.php +29 -12 2.0.23.1.0 View file →
@@ -23,13 +23,8 @@
23 23 * ProductsGrid class.
24 24 */
25 25 abstract class AdditionalQueryCustomLayout extends ElementorWidgetBase {
26 26 /**
27 - * Control Fields
28 - *
29 - * @var array
30 - */
31 - /**
32 27 * Action Button Traits.
33 28 */
34 29 use ActionBtnTraits;
35 30
@@ -82,10 +77,8 @@
82 77 $this->widget_query()
83 78 )
84 79 );
85 80
86 - unset( $fields['grid_style'] );
87 -
88 81 return $fields;
89 82 }
90 83
91 84 /**
@@ -110,15 +103,16 @@
110 103 unset( $content_visibility['show_title']['separator'] );
111 104
112 105 $sections = array_merge(
113 106 $content_visibility,
107 + Controls\SettingsFields::content_ordering( $this ),
108 + Controls\SettingsFields::section_title( $this ),
114 109 Controls\SettingsFields::image( $this ),
115 110 Controls\SettingsFields::action_buttons( $this ),
116 - Controls\SettingsFields::section_title( $this ),
117 111 Controls\SettingsFields::product_title( $this ),
118 112 Controls\SettingsFields::product_excerpt( $this ),
119 113 Controls\SettingsFields::badges( $this ),
120 - Controls\SettingsFields::variation_swatch( $this ),
114 + $this->variation_swatch_conditionaly(),
121 115 Controls\SettingsFields::links( $this )
122 116 );
123 117 return apply_filters( 'rtsb/elements/elementor/product_custom_settings_tab', $sections, $this );
124 118 }
@@ -129,13 +123,31 @@
129 123 */
130 124 protected function widget_layout() {
131 125 return Controls\LayoutFields::grid_layout( $this );
132 126 }
127 +
133 128 /**
134 129 * Controls for layout tab
135 130 *
136 131 * @return array
137 132 */
133 + public function variation_swatch_conditionaly() {
134 + if ( ! function_exists( 'rtwpvsp' ) && ! rtsb()->has_pro() ) {
135 + return [];
136 + }
137 + $swatches_controls = Controls\SettingsFields::variation_swatch( $this );
138 + if ( ! empty( $swatches_controls['swatch_position'] ) ) {
139 + $swatches_controls['swatch_position']['condition'] = [
140 + 'layout' => [ 'grid-layout1' ],
141 + ];
142 + }
143 + return $swatches_controls;
144 + }
145 + /**
146 + * Controls for layout tab
147 + *
148 + * @return array
149 + */
138 150 protected function widget_query() {
139 151 $additional_query = Controls\LayoutFields::additional_query( $this );
140 152 $additional_query['posts_limit']['separator'] = 'default';
141 153 return $additional_query;
@@ -140,8 +152,13 @@
140 152 $additional_query['posts_limit']['separator'] = 'default';
141 153 return $additional_query;
142 154 }
143 155
156 + /**
157 + * Controls for style tab
158 + *
159 + * @return array
160 + */
144 161 protected function pagination_navigation() {
145 162 return Controls\StyleFields::pagination( $this );
146 163 }
147 164
@@ -177,9 +194,9 @@
177 194
178 195 /**
179 196 * Widget Field
180 197 *
181 - * @return void|array
198 + * @return string
182 199 */
183 200 protected function render_template_file() {
184 201 return 'elementor/general/grid/';
185 202 }
@@ -196,9 +213,9 @@
196 213 $this->render_start();
197 214 $args = [
198 215 'posts_per_page' => $settings['posts_limit'],
199 216 'columns' => $settings['posts_limit'],
200 - 'orderby' => $settings['posts_order_by'], // @codingStandardsIgnoreLine.
217 + 'orderby' => $settings['posts_order_by'],
201 218 'order' => $settings['posts_order'],
202 219 ];
203 220
204 221 $settings['query_products'] = $this->get_the_products( $args );
@@ -210,11 +227,11 @@
210 227 if ( $this->is_builder_mode() ) {
211 228 add_filter( 'wp_kses_allowed_html', [ FilterHooks::class, 'custom_wpkses_post_tags' ], 10, 2 );
212 229 }
213 230
231 + // Call the template rendering method.
214 232 Fns::print_html( Render::instance()->setup_loop_for_product_view( $this->render_template_file(), $settings, $this ), true );
215 233
216 234 $this->action_button_icon_set_default();
217 235 $this->render_end();
218 236 }
219 -
220 237 }