PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.0.0
ShopBuilder – WooCommerce Builder For Elementor v2.0.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/Controllers/BuilderController.php +25 -65 2.1.72.0.0 View file →
@@ -6,8 +6,9 @@
6 6 */
7 7
8 8 namespace RadiusTheme\SB\Controllers;
9 9
10 +use Elementor\Plugin;
10 11 use RadiusTheme\SB\Helpers\Fns;
11 12 use RadiusTheme\SB\Helpers\BuilderFns;
12 13 use RadiusTheme\SB\Traits\SingletonTrait;
13 14 use RadiusTheme\SB\Controllers\Builder\BuilderCpt;
@@ -25,13 +26,8 @@
25 26 * Builder Controller
26 27 */
27 28 class BuilderController {
28 29 /**
29 - * @var array
30 - */
31 - private static $cache = [];
32 -
33 - /**
34 30 * Builder page id.
35 31 *
36 32 * @var integer
37 33 */
@@ -61,14 +57,11 @@
61 57 }
62 58
63 59 BuilderCpt::instance();
64 60
65 - $this->elementor_init();
66 - $this->both_builder_frontend();
67 -
68 - // add_action( 'elementor/init', [ $this, 'elementor_init' ] );
61 + add_action( 'elementor/init', [ $this, 'elementor_init' ] );
69 62 add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'editor_scripts' ] );
70 - // add_action( 'template_redirect', [ $this, 'both_builder_frontend' ], 99 );
63 + add_action( 'template_redirect', [ $this, 'both_builder_frontend' ], 99 );
71 64
72 65 // RT Select2 Ajax.
73 66 add_action( 'wp_ajax_rt_select2_object_search', [ $this, 'select2_ajax_posts_filter_autocomplete' ] );
74 67 add_action( 'wp_ajax_nopriv_rt_select2_object_search', [ $this, 'select2_ajax_posts_filter_autocomplete' ] );
@@ -156,11 +149,16 @@
156 149 *
157 150 * @since 1.0.0
158 151 */
159 152 public function init_widgets( $widgets_manager ) {
153 + $product = Fns::get_product();
160 154
161 - $get_list = ElementList::instance()->get_list( true, 'active' );
162 - foreach ( $get_list as $element ) {
155 + // TODO: Need to remove below condition and make compitability in each widgets.
156 + if ( ! $product ) {
157 + return;
158 + }
159 +
160 + foreach ( ElementList::instance()->get_list( true, 'active' ) as $element ) {
163 161 if ( isset( $element['active'] ) && 'on' !== $element['active'] ) {
164 162 continue;
165 163 }
166 164
@@ -222,10 +220,23 @@
222 220 *
223 221 * @return array
224 222 */
225 223 public function rtsb_icons( $tabs = [] ) {
226 - $custom_icons = $this->get_icons();
224 + $fonts = rtsb()->get_assets_uri( 'fonts/rtsb-icons.json' );
227 225
226 + $response = wp_remote_get( $fonts );
227 +
228 + if ( is_wp_error( $response ) ) {
229 + return $tabs;
230 + }
231 +
232 + $icons_json = wp_remote_retrieve_body( $response );
233 + $custom_icons = json_decode( $icons_json, true );
234 +
235 + if ( null === $custom_icons ) {
236 + return $tabs;
237 + }
238 +
228 239 $tabs['shopbuilder-icons'] = [
229 240 'name' => 'rtsb-fonts',
230 241 'label' => esc_html__( 'ShopBuilder Icons', 'shopbuilder' ),
231 242 'labelIcon' => 'fab fa-elementor',
@@ -306,14 +317,9 @@
306 317
307 318 ?>
308 319 <!-- Before Content start -->
309 320 <div class="<?php echo esc_attr( implode( ' ', $parent_class ) ); ?>">
310 - <?php
311 - if ( BuilderFns::is_checkout() ) {
312 - if ( ! apply_filters( 'rtsb/multi/step/checkout/widget', true ) ) {
313 - return;
314 - }
315 - ?>
321 + <?php if ( BuilderFns::is_checkout() ) { ?>
316 322 <form name="checkout" method="post" class="rtsb-woocommerce-checkout checkout" action="<?php echo esc_url( wc_get_checkout_url() ); ?>" enctype="multipart/form-data">
317 323 <?php
318 324 }
319 325 }
@@ -335,11 +341,8 @@
335 341 do_action( 'elementor/page_templates/header-footer/after_content' );
336 342 }
337 343
338 344 if ( BuilderFns::is_checkout() ) {
339 - if ( ! apply_filters( 'rtsb/multi/step/checkout/widget', true ) ) {
340 - return;
341 - }
342 345 ?>
343 346 </form>
344 347 <?php
345 348 }
@@ -576,49 +579,6 @@
576 579 }
577 580 }
578 581
579 582 return $config;
580 - }
581 -
582 - /**
583 - * Get Icons.
584 - *
585 - * @return array
586 - */
587 - public function get_icons() {
588 - return [
589 - 'heart-empty',
590 - 'heart',
591 - 'eye',
592 - 'exchange',
593 - 'plus',
594 - 'minus',
595 - 'avatar',
596 - 'pay',
597 - 'share',
598 - 'clock',
599 - 'check-alt',
600 - 'check',
601 - 'delete',
602 - 'marker',
603 - 'list',
604 - 'list-2',
605 - 'power',
606 - 'cart',
607 - 'cart-2',
608 - 'cart-3',
609 - 'downloads',
610 - 'zoom',
611 - 'user-edit',
612 - 'grid',
613 - 'filter',
614 - 'billing',
615 - 'login',
616 - 'payment',
617 - 'search',
618 - 'edit',
619 - 'coupon',
620 - 'arrows-cw',
621 - 'trash-empty',
622 - ];
623 583 }
624 584 }