| @@ -19,9 +19,8 @@ | ||
| 19 | 19 | /** |
| 20 | 20 | * SingletonTrait. |
| 21 | 21 | */ |
| 22 | 22 | use SingletonTrait; |
| 23 | - | |
| 24 | 23 | /** |
| 25 | 24 | * Construct function |
| 26 | 25 | */ |
| 27 | 26 | private function __construct() { |
| @@ -27,9 +26,9 @@ | ||
| 27 | 26 | private function __construct() { |
| 28 | 27 | add_action( 'init', [ $this, 'plugins_support' ], 9 ); |
| 29 | 28 | add_action( 'init', [ $this, 'themes_support' ], 9 ); |
| 30 | 29 | add_filter( 'woocommerce_locate_template', [ $this, 'locate_template' ], 10, 3 ); |
| 31 | - if ( defined( 'RTSB_DEVELOPER_MODE' ) && RTSB_DEVELOPER_MODE ) { | |
| 30 | + if( defined( 'RTSB_DEVELOPER_MODE' ) && RTSB_DEVELOPER_MODE ){ | |
| 32 | 31 | $this->developer_support(); |
| 33 | 32 | } |
| 34 | 33 | } |
| 35 | 34 | |
| @@ -36,9 +35,9 @@ | ||
| 36 | 35 | /** |
| 37 | 36 | * @return void |
| 38 | 37 | */ |
| 39 | 38 | public function developer_support() { |
| 40 | - add_filter( 'rtsb/builder/preview/access', '__return_false', 5 ); | |
| 39 | + add_filter( 'rtsb/builder/args/publicly_queryable', '__return_true', 5 ); | |
| 41 | 40 | } |
| 42 | 41 | |
| 43 | 42 | /** |
| 44 | 43 | * Theme Support |
| @@ -48,14 +47,11 @@ | ||
| 48 | 47 | public function plugins_support() { |
| 49 | 48 | // Check for plugin using plugin name. |
| 50 | 49 | $active_plugin = apply_filters( 'active_plugins', get_option( 'active_plugins' ) ); |
| 51 | 50 | $supports = [ |
| 52 | - 'woo-address-book/woocommerce-address-book.php' => PluginsSupport\WooAddressBook::class, | |
| 53 | 51 | 'woo-product-variation-gallery/woo-product-variation-gallery.php' => PluginsSupport\RtwpvgSupport::class, |
| 54 | 52 | '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 | 53 | ]; |
| 57 | - $supports = apply_filters( 'rtsb/plugins/support', $supports ); | |
| 58 | 54 | foreach ( $supports as $active_path => $class ) { |
| 59 | 55 | $is_active = in_array( $active_path, $active_plugin, true ); |
| 60 | 56 | if ( $is_active && class_exists( $class ) && method_exists( $class, 'instance' ) ) { |
| 61 | 57 | $class::instance(); |
| @@ -95,13 +91,10 @@ | ||
| 95 | 91 | * @return void |
| 96 | 92 | */ |
| 97 | 93 | public function locate_template( $template, $template_name, $template_path ) { |
| 98 | 94 | if ( 'checkout/review-order.php' === $template_name && BuilderFns::is_checkout() ) { |
| 99 | - $id = BuilderFns::is_builder_preview() ? get_the_ID() : BuilderFns::builder_page_id_by_type( 'checkout' ); | |
| 100 | - $elmap = ElementorDataMap::instance(); | |
| 101 | - if ( ! $id ) { | |
| 102 | - return $template; | |
| 103 | - } | |
| 95 | + $id = BuilderFns::is_builder_preview() ? get_the_ID() : BuilderFns::builder_page_id_by_type( 'checkout' ); | |
| 96 | + $elmap = ElementorDataMap::instance(); | |
| 104 | 97 | $get_widget = $elmap->get_widget_data( 'rtsb-shipping-method', [], $id ); |
| 105 | 98 | if ( ! empty( $get_widget ) ) { |
| 106 | 99 | $template = Fns::locate_template( 'elementor/checkout/customized-order-review' ); |
| 107 | 100 | } |
| @@ -110,5 +103,7 @@ | ||
| 110 | 103 | } |
| 111 | 104 | |
| 112 | 105 | return $template; |
| 113 | 106 | } |
| 107 | + | |
| 108 | + | |
| 114 | 109 | } |