start_controls_section('widget',['label'=>'Yooty widget']); $this->add_control('type',['label'=>'Widget','type'=>\Elementor\Controls_Manager::SELECT,'default'=>'booking','options'=>['booking'=>'Unified booking widget','statistics'=>'Statistics · inline','reviews'=>'Reviews · inline','faq'=>'FAQ · inline','service_area'=>'Service area · inline','chat'=>'Chat · floating','newsletter'=>'Newsletter · floating','banner'=>'Promo banner · floating','app_install'=>'App installation · floating']]); $this->add_control('display',['label'=>'Booking display','type'=>\Elementor\Controls_Manager::SELECT,'default'=>'inline','options'=>['modal'=>'Button → booking dialog','inline'=>'Inline booking flow'],'condition'=>['type'=>'booking']]);foreach(['mode'=>[''=>'Use business setting','calculator'=>'Calculator → booking','booking'=>'Direct booking'],'view'=>[''=>'Use business setting','classic'=>'Classic steps','visual'=>'Visual carousel','scroll'=>'Scrolling sections'],'surface'=>[''=>'Use business setting','flat'=>'Flat','glass'=>'Glass','transparent'=>'Transparent'],'appearance'=>[''=>'Use business setting','auto'=>'Automatic','light'=>'Light','dark'=>'Dark']] as $key=>$options)$this->add_control($key,['label'=>ucfirst($key),'type'=>\Elementor\Controls_Manager::SELECT,'default'=>'','options'=>$options,'condition'=>['type'=>'booking']]);$this->end_controls_section(); } protected function render(){ if(\Elementor\Plugin::$instance->editor->is_edit_mode()){echo '
Yooty Widget

Configure the business under Settings → Yooty widgets. Preview the page to load the real widget.

';return;} $a=$this->get_settings_for_display();$type=$a['type']??'booking';if(!isset(yooty_growth_widget_catalog()[$type]))return;$args='';foreach(['display'=>['inline','modal'],'mode'=>['calculator','booking'],'view'=>['classic','visual','scroll'],'surface'=>['flat','glass','transparent'],'appearance'=>['auto','light','dark']] as $key=>$values)if(in_array($a[$key]??'',$values,true))$args.=' '.$key.'="'.$a[$key].'"';echo do_shortcode('[yooty_widget type="'.$type.'"'.$args.']'); } }