PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.5.1
ShopBuilder – WooCommerce Builder For Elementor v2.5.1
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/ElementorWidgetBase.php +17 -171 3.4.22.5.1 View file →
@@ -6,9 +6,8 @@
6 6 */
7 7
8 8 namespace RadiusTheme\SB\Abstracts;
9 9
10 -use Elementor\Group_Control_Css_Filter;
11 10 use Elementor\Plugin;
12 11 use Elementor\Repeater;
13 12 use Elementor\Widget_Base;
14 13 use Elementor\Controls_Manager;
@@ -20,9 +19,8 @@
20 19 use Elementor\Group_Control_Box_Shadow;
21 20 use Elementor\Group_Control_Text_Shadow;
22 21 use Elementor\Group_Control_Text_Stroke;
23 22 use RadiusTheme\SB\Elementor\Helper\ControlSelectors;
24 -use RadiusTheme\SB\Helpers\Fns;
25 23
26 24
27 25 // Do not allow directly accessing this file.
28 26 if ( ! defined( 'ABSPATH' ) ) {
@@ -188,9 +186,9 @@
188 186 *
189 187 * @return array
190 188 */
191 189 public function promo_content() {
192 - if ( rtsb()->has_pro() || $this->widget_exceptions() ) {
190 + if ( rtsb()->has_pro() ) {
193 191 return [];
194 192 }
195 193
196 194 $promo_fields = [];
@@ -298,14 +296,8 @@
298 296 }
299 297 if ( isset( $value['mode'] ) && 'responsive' === $value['mode'] ) {
300 298 unset( $value['mode'] );
301 299 $repeater->add_responsive_control( $rf_id, $value );
302 - } elseif ( isset( $value['mode'] ) && 'group' === $value['mode'] ) {
303 - $type = $value['type'];
304 - $value['name'] = $rf_id;
305 - unset( $value['mode'] );
306 - unset( $value['type'] );
307 - $repeater->add_group_control( $type, $value );
308 300 } else {
309 301 $repeater->add_control( $rf_id, $value );
310 302 }
311 303 }
@@ -339,103 +331,14 @@
339 331 return BuilderFns::is_builder_preview() || $this->is_edit_mode();
340 332 }
341 333
342 334 /**
343 - * Render a shared editor-only notice.
344 - *
345 - * Any widget can surface an editor placeholder (out of stock, no active
346 - * campaign, empty result, etc.) with one consistent design. Renders only in
347 - * edit/preview mode and prints the notice CSS inline once per request.
348 - *
349 - * The notice lives in the Elementor preview iframe, which loads only frontend
350 - * styles — so the rule is printed here instead of the editor panel stylesheet,
351 - * and kept out of the compiled frontend bundle.
352 - *
353 - * @param string $message Notice text (already translated).
354 - * @param string $extra_class Optional extra class for per-widget targeting.
355 - * @param string $title Optional hover tooltip; defaults to the editor-only hint.
356 - * @return void
357 - */
358 - public function editor_notice( $message, $extra_class = '', $title = '' ) {
359 - if ( ! $this->is_edit_mode() || '' === $message ) {
360 - return;
361 - }
362 - $this->editor_notice_style();
363 - $classes = trim( 'rtsb-editor-notice ' . $extra_class );
364 - $title = '' !== $title ? $title : esc_html__( 'This notice is only visible in the Elementor editor.', 'shopbuilder' );
365 - ?>
366 - <div class="<?php echo esc_attr( $classes ); ?>" title="<?php echo esc_attr( $title ); ?>">
367 - <span class="rtsb-editor-notice__label"><?php echo esc_html__( 'Editor Notice:', 'shopbuilder' ); ?></span>
368 - <?php echo esc_html( $message ); ?>
369 - </div>
370 - <?php
371 - }
372 -
373 - /**
374 - * Print the shared editor-notice CSS inline, once per request.
375 - *
376 - * @return void
377 - */
378 - protected function editor_notice_style() {
379 - static $printed = false;
380 - if ( $printed ) {
381 - return;
382 - }
383 - $printed = true;
384 - ?>
385 - <style>
386 - .rtsb-editor-notice {
387 - position: relative;
388 - max-height: 500px;
389 - padding: 12px 16px 12px 44px;
390 - border: 1px solid #f0b849;
391 - border-left: 4px solid #f0b849;
392 - border-radius: 4px;
393 - background: #fff8e5;
394 - color: #8a6d3b;
395 - font-size: 13px;
396 - font-weight: 500;
397 - line-height: 1.5;
398 - box-shadow: 0 1px 4px rgba(138, 109, 59, 0.2);
399 - cursor: help;
400 - overflow: hidden;
401 - opacity: 1;
402 - transition: opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease, padding 0.3s ease, border-width 0.3s ease;
403 - }
404 - .rtsb-editor-notice::before {
405 - content: "\26A0";
406 - position: absolute;
407 - top: 50%;
408 - left: 16px;
409 - transform: translateY(-50%);
410 - font-size: 18px;
411 - line-height: 1;
412 - }
413 - .rtsb-editor-notice__label {
414 - font-weight: 700;
415 - margin-right: 4px;
416 - }
417 - /* Fade + collapse the notice when the editor panel is hidden (preview toggle). */
418 - .elementor-editor-preview .rtsb-editor-notice {
419 - max-height: 0;
420 - margin-top: 0;
421 - padding-top: 0;
422 - padding-bottom: 0;
423 - border-top-width: 0;
424 - border-bottom-width: 0;
425 - opacity: 0;
426 - }
427 - </style>
428 - <?php
429 - }
430 -
431 - /**
432 335 * Elementor Edit mode need some extra js for isotop reinitialize
433 336 *
434 337 * @return void
435 338 */
436 339 public function editor_slider_script() {
437 - if ( ! empty( \Elementor\Plugin::$instance->editor ) && \Elementor\Plugin::$instance->editor->is_edit_mode() ) {
340 + if ( \Elementor\Plugin::$instance->editor->is_edit_mode() ) {
438 341 $selector = $this->get_unique_selector() . ' .rtsb-carousel-slider';
439 342 ?>
440 343 <script>
441 344 jQuery('<?php echo esc_attr( $selector ); ?>').rtsb_slider();
@@ -462,8 +365,9 @@
462 365 var cartButton = cartWrpper.find(
463 366 '.product_type_grouped, .add_to_cart_button, .single_add_to_cart_button '
464 367 );
465 368 if (cartIcon) {
369 + //console.log( cartButton.find('svg') )
466 370 cartButton.find('i').remove();
467 371 cartButton.find('svg').remove();
468 372 cartButton.find('img').remove();
469 373 cartButton.prepend(cartIcon);
@@ -484,10 +388,8 @@
484 388 if ( ! $this->is_edit_mode() ) {
485 389 return;
486 390 }
487 391 $ajaxurl = admin_url( 'admin-ajax.php' );
488 -
489 - // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
490 392 if ( in_array( 'sitepress-multilingual-cms/sitepress.php', get_option( 'active_plugins' ) ) ) {
491 393 $ajaxurl = admin_url( 'admin-ajax.php?lang=' . ICL_LANGUAGE_CODE );
492 394 }
493 395 ?>
@@ -494,59 +396,23 @@
494 396 <script>
495 397 var rtsb = {
496 398 ajaxurl: '<?php echo esc_url( $ajaxurl ); ?>',
497 399 nonce: '<?php echo esc_attr( wp_create_nonce( rtsb()->nonceId ) ); ?>',
498 - is_pro: '<?php echo esc_attr( rtsb()->has_pro() ? 'true' : 'false' ); ?>',
499 - isOptimizationEnabled: '<?php echo esc_attr( Fns::is_optimization_enabled() ); ?>'
400 + is_pro: '<?php echo esc_attr( rtsb()->has_pro() ? 'true' : 'false' ); ?>'
500 401 };
501 402
502 - if (!rtsb.isOptimizationEnabled) {
503 - rtsbElFrontend();
403 + rtsbElFrontend();
504 404
505 - setTimeout(function() {
506 - rtsbProductPageInit();
507 - }, 1000);
508 - } else {
509 - if (typeof elementorFrontend !== 'undefined') {
510 - window.waitForRTSB((RTSB) => {
511 - RTSB.modules.get('elementorInit')?.refresh();
512 - RTSB.modules.get('singleProductTabs')?.refresh();
513 - RTSB.modules.get('reviewFormStar')?.refresh();
514 - RTSB.modules.get('addCartIcon')?.refresh();
515 - RTSB.modules.get('productImage')?.refresh();
516 - RTSB.modules.get('CartQuantityHandler')?.refresh();
517 - });
518 - }
519 - }
520 -
405 + setTimeout(function() {
406 + rtsbProductPageInit();
407 + }, 1000);
521 408 <?php if ( rtsb()->has_pro() ) { ?>
522 - var isMasonry = jQuery('.rtsb-elementor-container .rtsb-masonry');
523 -
524 - if(isMasonry.length > 0) {
525 - isMasonry.masonry();
409 + if (typeof rtsbFilters === 'function') {
410 + rtsbFilters();
526 411 }
527 -
528 - if (!'<?php echo esc_attr( Fns::is_optimization_enabled() ); ?>') {
529 - <?php if ( 'rtsb-ajax-product-filters' === $this->rtsb_base ) { ?>
530 - if (typeof rtsbFilters === 'function') {
531 - rtsbFilters();
532 - }
533 - <?php } ?>
534 -
535 - setTimeout( function (){
536 - window.rtsbCountdownApply();
537 - }, 1000 );
538 - } else {
539 - if (typeof elementorFrontend !== 'undefined') {
540 - window.waitForRTSB((RTSB) => {
541 - RTSB.modules.get('countdownPro')?.refresh();
542 - RTSB.modules.get('elementorInitPro')?.refresh();
543 - <?php if ( 'rtsb-ajax-product-filters' === $this->rtsb_base ) { ?>
544 - RTSB.modules.get('ajaxProductFiltersPro')?.refresh();
545 - <?php } ?>
546 - });
547 - }
548 - }
412 + setTimeout( function (){
413 + window.rtsbCountdownApply();
414 + }, 1000 );
549 415 <?php } ?>
550 416 </script>
551 417
552 418 <?php
@@ -792,16 +658,13 @@
792 658
793 659 case 'text-stroke':
794 660 $type = Group_Control_Text_Stroke::get_type();
795 661 break;
796 -
797 - case 'css-filter':
798 - $type = Group_Control_Css_Filter::get_type();
799 - break;
800 662 default:
801 663 $type = constant( 'Elementor\Controls_Manager::' . strtoupper( $type ) );
802 664
803 665 }
666 +
804 667 return $type;
805 668 }
806 669
807 670 /**
@@ -832,11 +695,9 @@
832 695 }
833 696 /**
834 697 * Archive Custom Layout Widget Rendering.
835 698 *
836 - * @param array $classes class list.
837 - *
838 - * @return array
699 + * @return void
839 700 */
840 701 public function countdown_campaign_parent_class( $classes ) {
841 702 $settings = $this->get_settings_for_display();
842 703 $layout = $settings['countdown_layout'] ?? 'horizontal';
@@ -852,9 +713,9 @@
852 713 ];
853 714 $classes = array_filter(
854 715 $classes,
855 716 function ( $item ) use ( $remove ) {
856 - return ! in_array( $item, $remove ); // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
717 + return ! in_array( $item, $remove );
857 718 }
858 719 );
859 720 $new_class = 'rtsb-countdown-' . esc_attr( $countdown_preset );
860 721 $new_class .= ' rtsb-countdown-' . esc_attr( $layout );
@@ -885,9 +746,9 @@
885 746
886 747 /**
887 748 * Elementor controls marge all settings
888 749 *
889 - * @return void
750 + * @return array
890 751 */
891 752 protected function apply_hooks_before_render() {
892 753 if ( $this->is_edit_mode() ) {
893 754 add_filter( 'wp_calculate_image_srcset_meta', '__return_null' );
@@ -903,21 +764,6 @@
903 764 protected function has_checkout_restriction() {
904 765 $checkout = WC()->checkout();
905 766
906 767 return ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in();
907 - }
908 -
909 - /**
910 - * Widget Exceptions.
911 - *
912 - * @return bool
913 - */
914 - private function widget_exceptions() {
915 - $exceptions = [
916 - 'rtsb-product-filters',
917 - 'rtsb-wishlist',
918 - 'rtsb-product-breadcrumbs',
919 - ];
920 -
921 - return in_array( $this->rtsb_base, $exceptions, true );
922 768 }
923 769 }