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
← All changes | app/Controllers/BuilderController.php +24 -56 2.1.02.0.2 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',
@@ -568,49 +579,6 @@
568 579 }
569 580 }
570 581
571 582 return $config;
572 - }
573 -
574 - /**
575 - * Get Icons.
576 - *
577 - * @return array
578 - */
579 - public function get_icons() {
580 - return [
581 - 'heart-empty',
582 - 'heart',
583 - 'eye',
584 - 'exchange',
585 - 'plus',
586 - 'minus',
587 - 'avatar',
588 - 'pay',
589 - 'share',
590 - 'clock',
591 - 'check-alt',
592 - 'check',
593 - 'delete',
594 - 'marker',
595 - 'list',
596 - 'list-2',
597 - 'power',
598 - 'cart',
599 - 'cart-2',
600 - 'cart-3',
601 - 'downloads',
602 - 'zoom',
603 - 'user-edit',
604 - 'grid',
605 - 'filter',
606 - 'billing',
607 - 'login',
608 - 'payment',
609 - 'search',
610 - 'edit',
611 - 'coupon',
612 - 'arrows-cw',
613 - 'trash-empty',
614 - ];
615 583 }
616 584 }