| @@ -11,9 +11,8 @@ | ||
| 11 | 11 | |
| 12 | 12 | use RadiusTheme\SB\Helpers\Fns; |
| 13 | 13 | use RadiusTheme\SB\Helpers\BuilderFns; |
| 14 | 14 | use RadiusTheme\SB\Traits\SingletonTrait; |
| 15 | -use RadiusTheme\SBPRO\Helpers\FnsPro; | |
| 16 | 15 | |
| 17 | 16 | /** |
| 18 | 17 | * Builder Frontend. |
| 19 | 18 | */ |
| @@ -23,8 +22,9 @@ | ||
| 23 | 22 | * |
| 24 | 23 | * @var integer |
| 25 | 24 | */ |
| 26 | 25 | private $builder_page_id = 0; |
| 26 | + | |
| 27 | 27 | /** |
| 28 | 28 | * Page Edit By. |
| 29 | 29 | * |
| 30 | 30 | * @var string |
| @@ -29,12 +29,14 @@ | ||
| 29 | 29 | * |
| 30 | 30 | * @var string |
| 31 | 31 | */ |
| 32 | 32 | private $page_edit_with = ''; |
| 33 | + | |
| 33 | 34 | /** |
| 34 | 35 | * Singleton. |
| 35 | 36 | */ |
| 36 | 37 | use SingletonTrait; |
| 38 | + | |
| 37 | 39 | /** |
| 38 | 40 | * Final constructor. |
| 39 | 41 | */ |
| 40 | 42 | private function __construct() { |
| @@ -41,9 +43,8 @@ | ||
| 41 | 43 | // Template Redirect hook run after the global query. |
| 42 | 44 | add_action( 'template_redirect', [ $this, 'frontend_init' ] ); |
| 43 | 45 | add_filter( 'rtsb/builder/set/current/page/type', [ $this, 'builder_page_type' ] ); |
| 44 | 46 | add_filter( 'body_class', [ $this, 'product_page_body_class' ] ); |
| 45 | - add_filter('rtsb/multi/step/checkout/widget',[__CLASS__,'multi_step_checkout_widget_builder_hooks']); | |
| 46 | 47 | } |
| 47 | 48 | |
| 48 | 49 | /** |
| 49 | 50 | * Builder page Body class. |
| @@ -53,9 +54,8 @@ | ||
| 53 | 54 | */ |
| 54 | 55 | public function product_page_body_class( $classes ) { |
| 55 | 56 | $classes[] = 'rtsb-shopbuilder-plugin rtsb_theme_' . rtsb()->current_theme; |
| 56 | 57 | if ( Fns::is_woocommerce() || BuilderFns::is_builder_preview() ) { |
| 57 | - $classes[] = 'woocommerce'; | |
| 58 | 58 | $classes[] = 'woocommerce-page'; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | if ( BuilderFns::is_product() ) { |
| @@ -67,8 +67,14 @@ | ||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | if ( BuilderFns::is_cart() ) { |
| 70 | 70 | $classes[] = 'woocommerce-cart'; |
| 71 | + // $indexToRemove = array_search( 'woocommerce' , $classes); | |
| 72 | + // if ($indexToRemove !== false) { | |
| 73 | + // unset($classes[$indexToRemove]); | |
| 74 | + // } | |
| 75 | + } else{ | |
| 76 | + $classes[] = 'woocommerce'; | |
| 71 | 77 | } |
| 72 | 78 | |
| 73 | 79 | if ( BuilderFns::is_checkout() ) { |
| 74 | 80 | $classes[] = 'woocommerce-checkout '; |
| @@ -73,8 +79,23 @@ | ||
| 73 | 79 | if ( BuilderFns::is_checkout() ) { |
| 74 | 80 | $classes[] = 'woocommerce-checkout '; |
| 75 | 81 | } |
| 76 | 82 | |
| 83 | + if ( rtsb()->has_pro() ) { | |
| 84 | + $disable_cart = Fns::is_guest_feature_disabled( 'hide_cart_page', '' ); | |
| 85 | + $disable_checkout = Fns::is_guest_feature_disabled( 'hide_checkout_page', '' ); | |
| 86 | + | |
| 87 | + if ( $disable_cart || $disable_checkout ) { | |
| 88 | + $classes[] = 'rtsb-not-visible'; | |
| 89 | + } | |
| 90 | + } | |
| 91 | + | |
| 92 | + $hide_notification = Fns::get_option( 'general', 'notification', 'hide_notification', '' ); | |
| 93 | + | |
| 94 | + if ( 'on' === $hide_notification ) { | |
| 95 | + $classes[] = 'rtsb-notifications-hidden'; | |
| 96 | + } | |
| 97 | + | |
| 77 | 98 | return $classes; |
| 78 | 99 | } |
| 79 | 100 | /** |
| 80 | 101 | * Undocumented function |
| @@ -177,11 +198,6 @@ | ||
| 177 | 198 | $content = apply_filters( 'the_content', $content ); |
| 178 | 199 | $output = str_replace( ']]>', ']]>', $content ); |
| 179 | 200 | } |
| 180 | 201 | echo wp_kses_post( $output ); |
| 181 | - } | |
| 182 | - | |
| 183 | - public static function multi_step_checkout_widget_builder_hooks() { | |
| 184 | - | |
| 185 | - return ! FnsPro::checkout_page_has_multi_step_widget(); | |
| 186 | 202 | } |
| 187 | 203 | } |