PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.1.13
ShopBuilder – WooCommerce Builder For Elementor v2.1.13
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/SupportController.php +19 -18 3.4.22.1.13 View file →
@@ -5,9 +5,9 @@
5 5 use RadiusTheme\SB\Helpers\BuilderFns;
6 6 use RadiusTheme\SB\Helpers\ElementorDataMap;
7 7 use RadiusTheme\SB\Helpers\Fns;
8 8 use RadiusTheme\SB\Traits\SingletonTrait;
9 -
9 +use RadiusTheme\SB\Controllers\PluginsSupport;
10 10 // Do not allow directly accessing this file.
11 11 if ( ! defined( 'ABSPATH' ) ) {
12 12 exit( 'This script cannot be accessed directly.' );
13 13 }
@@ -26,9 +26,9 @@
26 26 */
27 27 private function __construct() {
28 28 add_action( 'init', [ $this, 'plugins_support' ], 9 );
29 29 add_action( 'init', [ $this, 'themes_support' ], 9 );
30 - add_filter( 'woocommerce_locate_template', [ $this, 'locate_template' ], 10, 2 );
30 + add_filter( 'woocommerce_locate_template', [ $this, 'locate_template' ], 10, 3 );
31 31 if ( defined( 'RTSB_DEVELOPER_MODE' ) && RTSB_DEVELOPER_MODE ) {
32 32 $this->developer_support();
33 33 }
34 34 }
@@ -36,9 +36,9 @@
36 36 /**
37 37 * @return void
38 38 */
39 39 public function developer_support() {
40 - add_filter( 'rtsb/builder/preview/access', '__return_false', 5 );
40 + add_filter( 'rtsb/builder/args/publicly_queryable', '__return_true', 5 );
41 41 }
42 42
43 43 /**
44 44 * Theme Support
@@ -51,11 +51,8 @@
51 51 $supports = [
52 52 'woo-address-book/woocommerce-address-book.php' => PluginsSupport\WooAddressBook::class,
53 53 'woo-product-variation-gallery/woo-product-variation-gallery.php' => PluginsSupport\RtwpvgSupport::class,
54 54 'woo-product-variation-swatches-pro/woo-product-variation-swatches-pro.php' => PluginsSupport\RtwpvsSupport::class,
55 - 'products-visibility-by-user-roles/addify_product_visibility.php' => PluginsSupport\AddifyVisibilityByRoles::class,
56 - 'woocommerce-payments/woocommerce-payments.php' => PluginsSupport\WooPaymentsSupport::class,
57 - 'woocommerce-paypal-payments/woocommerce-paypal-payments.php' => PluginsSupport\PayPalPPCPSupport::class,
58 55 ];
59 56 $supports = apply_filters( 'rtsb/plugins/support', $supports );
60 57 foreach ( $supports as $active_path => $class ) {
61 58 $is_active = in_array( $active_path, $active_plugin, true );
@@ -72,9 +69,9 @@
72 69 public function themes_support() {
73 70 $themeClass = ucwords( str_replace( [ '_', '-', ' ' ], '', rtsb()->current_theme ) );
74 71
75 72 $supportClass = apply_filters(
76 - 'RadiusTheme/SB/ThemesSupport/Class', // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
73 + 'RadiusTheme/SB/ThemesSupport/Class',
77 74 [
78 75 'ThemesSupport' => 'RadiusTheme\SB\Controllers\ThemesSupport\\' . $themeClass . '\\ThemeSupport',
79 76 'TheTheme' => '\ThemeSupport',
80 77 ]
@@ -91,22 +88,26 @@
91 88 }
92 89 }
93 90
94 91 /**
95 - * Filters and overrides the default WooCommerce template paths for specific templates
96 - * based on builder context and available Elementor widgets.
92 + * Theme Support
97 93 *
98 - * - Replaces the checkout review order template if a custom widget is present.
99 - * - Replaces the single product description tab template if on a product page.
100 - *
101 - * @param string $template The path to the template to include.
102 - * @param string $template_name The name of the template.
103 - *
104 - * @return string Modified or original template path.
94 + * @return void
105 95 */
106 - public function locate_template( $template, $template_name ) {
107 - if ( 'single-product/tabs/description.php' === $template_name && BuilderFns::is_product() ) {
96 + public function locate_template( $template, $template_name, $template_path ) {
97 + if ( 'checkout/review-order.php' === $template_name && BuilderFns::is_checkout() ) {
98 + $id = BuilderFns::is_builder_preview() ? get_the_ID() : BuilderFns::builder_page_id_by_type( 'checkout' );
99 + $elmap = ElementorDataMap::instance();
100 + if ( ! $id ) {
101 + return $template;
102 + }
103 + $get_widget = $elmap->get_widget_data( 'rtsb-shipping-method', [], $id );
104 + if ( ! empty( $get_widget ) ) {
105 + $template = Fns::locate_template( 'elementor/checkout/customized-order-review' );
106 + }
107 + } elseif ( 'single-product/tabs/description.php' === $template_name && BuilderFns::is_product() ) {
108 108 $template = Fns::locate_template( 'elementor/single-product/tab-description' );
109 109 }
110 +
110 111 return $template;
111 112 }
112 113 }