rtsb_name = esc_html__( 'Actions Button', 'shopbuilder' ); $this->rtsb_base = 'rtsb-actions-button'; parent::__construct( $data, $args ); } /** * Widget Field * * @return array */ public function widget_fields() { $fields = ActionsBtnSettings::widget_fields( $this ); // error_log( print_r( Fns::selector_generator( $fields ) , true ) . "\n\n" , 3, __DIR__ . '/log.txt' ); return apply_filters( 'rtsb/elements/elementor/single/' . $this->rtsb_base, $fields, $this ); } /** * Set Widget Keyword. * * @return array */ public function get_keywords() { return [ 'Compare', 'Wishlist' ] + parent::get_keywords(); } /** * Render Function * * @return void */ protected function render() { global $post, $product; $_product = $product; $product = Fns::get_product(); $controllers = $this->get_settings_for_display(); $this->action_button_icon_modify(); $this->theme_support(); ob_start(); if ( ! empty( $controllers['wishlist_button'] ) ) { do_action('rtsb/modules/wishlist/frontend/display' ); } if ( ! empty( $controllers['comparison_button'] ) ) { do_action('rtsb/modules/compare/frontend/display' ); } $button_html = ob_get_clean(); if ( empty( $button_html ) && $this->is_builder_mode() ) { $button_html = $this->rtsb_name; } $data = [ 'template' => 'elementor/single-product/actions-button', 'controllers' => $controllers, 'content' => $button_html, ]; Fns::load_template( $data['template'], $data ); $this->theme_support( 'render_reset' ); $product = $_product; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited $this->action_button_icon_set_default(); } }