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