namespace RTLPlugins\AstarehWidgets\Widgets; use Elementor\Controls_Manager; use Elementor\Group_Control_Border; use Elementor\Group_Control_Typography; use Elementor\Icons_Manager; use Elementor\Plugin; use Elementor\Utils; use Elementor\Widget_base; use RTLPlugins\AstarehCore\Admin\OptionLogic; use RTLPlugins\AstarehCore\Controllers\MetaboxController; use RTLPlugins\AstarehCore\Controllers\OptionController; use RTLPlugins\AstarehCore\Controllers\PostTypeController; use RTLPlugins\AstarehWidgets\Helper; use RTLPlugins\AstarehCore\Helper as CoreHelper; use WP_Query; if (defined("ABSPATH")) { goto O720892627430; } goto O237867510675; O720892627430: goto O704101786323; O237867510675: goto O997804175403; O704101786323: goto O086365287327; O997804175403: exit; O086365287327: class ComparisonPlansWidget extends Widget_base { public function get_name() { return Helper::genertateWidgetName("comparison-plans"); } public function get_title() { return esc_html__("Comparison Plans", ASTAREH_WIDGETS_TEXTDOMAIN); } public function get_icon() { return "eicon-price-table"; } public function get_categories() { return [Helper::getElementsSlug()]; } public function get_keywords() { return ["comparison", "comparison plans", __("Comparison", ASTAREH_WIDGETS_TEXTDOMAIN), __("Comparison Plans", ASTAREH_WIDGETS_TEXTDOMAIN)]; } protected function register_controls() { $this->section_posts(); $this->section_content(); $this->section_section_box(); $this->section_box_table(); $this->section_header_plan(); $this->section_plan_title(); $this->section_plan_currency(); $this->section_plan_amount(); $this->section_plan_date_type(); $this->section_order_button(); $this->section_body_plan(); } private function section_posts() { $this->start_controls_section("posts_section", ["label" => esc_html__("Posts", ASTAREH_WIDGETS_TEXTDOMAIN), "tab" => Controls_Manager::TAB_CONTENT]); $this->add_control("service_selected_terms", ["label" => __("Category", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::SELECT2, "options" => $this->getCategories(), "multiple" => true]); $this->add_control("services_order_by", ["label" => __("Order By", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::SELECT, "options" => ["none" => __("None", ASTAREH_WIDGETS_TEXTDOMAIN), "ID" => __("ID", ASTAREH_WIDGETS_TEXTDOMAIN), "name" => __("Name", ASTAREH_WIDGETS_TEXTDOMAIN), "title" => __("Title", ASTAREH_WIDGETS_TEXTDOMAIN), "date" => __("Date", ASTAREH_WIDGETS_TEXTDOMAIN), "modified" => __("Last Modified", ASTAREH_WIDGETS_TEXTDOMAIN), "rand" => __("Random", ASTAREH_WIDGETS_TEXTDOMAIN)], "default" => "date"]); $this->add_control("services_order", ["label" => __("Order", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::SELECT, "options" => ["ASC" => __("ASC", ASTAREH_WIDGETS_TEXTDOMAIN), "DESC" => __("DESC", ASTAREH_WIDGETS_TEXTDOMAIN)], "default" => "DESC"]); $this->add_control("services_posts_per_category", ["label" => __("Post per Category", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::NUMBER, "default" => -1]); $this->add_control("services_post_status", ["label" => __("Post Status", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::SELECT, "options" => ["publish" => __("Publish", ASTAREH_WIDGETS_TEXTDOMAIN), "draft" => __("Draft", ASTAREH_WIDGETS_TEXTDOMAIN), "pending" => __("Pending", ASTAREH_WIDGETS_TEXTDOMAIN), "any" => __("Any", ASTAREH_WIDGETS_TEXTDOMAIN)], "default" => "publish"]); $this->add_control("services_post_date_type", ["label" => __("Date Type", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::SELECT, "options" => ["monthly" => __("Monthly", ASTAREH_WIDGETS_TEXTDOMAIN), "yearly" => __("Yearly", ASTAREH_WIDGETS_TEXTDOMAIN)], "default" => "monthly"]); $this->add_control("services_excluded_posts", ["label" => __("Excluded Posts", ASTAREH_WIDGETS_TEXTDOMAIN), "description" => __("Input post IDs seperated by Space here.", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::TEXTAREA]); $this->end_controls_section(); } protected function getCategories() { $terms = get_terms(["taxonomy" => PostTypeController::getServiceCategoryTaxonomySlug(), "hide_empty" => true]); $options = []; if (!(!is_wp_error($terms) && !empty($terms))) { goto O061989781573; } goto O435716992803; O061989781573: goto O400692216341; O435716992803: goto O249617504974; O400692216341: goto O542138724447; O249617504974: foreach ($terms as $term) { $options[$term->term_id] = $term->name; O852294362908: O512271276700: O684401123337: O885987965611: O058597469429: } O158143362411: O046051410541: O965839038724: O267450785822: O771651505016: O542138724447: return $options; } private function section_content() { $this->start_controls_section("content_section", ["label" => esc_html__("Content", ASTAREH_WIDGETS_TEXTDOMAIN), "tab" => Controls_Manager::TAB_CONTENT]); $this->add_control("service_monthly_text", ["label" => esc_html__("Monthly Text", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::TEXT, "default" => esc_html__("Monthly", ASTAREH_WIDGETS_TEXTDOMAIN)]); $this->add_control("service_order_plan_text", ["label" => esc_html__("Order Plan Text", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::TEXT, "default" => esc_html__("Order Plan", ASTAREH_WIDGETS_TEXTDOMAIN)]); $this->add_control("service_yearly_text", ["label" => esc_html__("Yearly Text", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::TEXT, "default" => esc_html__("Yearly", ASTAREH_WIDGETS_TEXTDOMAIN)]); $this->end_controls_section(); } private function section_section_box() { $this->start_controls_section("section_section_box", ["label" => esc_html__("Section Box", ASTAREH_WIDGETS_TEXTDOMAIN), "tab" => Controls_Manager::TAB_STYLE]); $this->add_control("section_box_shadow", ["label" => __("Box Shadow", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::BOX_SHADOW, "selectors" => ["{{WRAPPER}} .hl-table__container" => "box-shadow: {{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{SPREAD}}px {{COLOR}};"], "default" => ["horizontal" => 0, "vertical" => 7, "blur" => 15, "spread" => 0, "color" => "#00"]]); $this->add_control("section_box_border_radius", ["label" => __("Border Radius", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "%"], "selectors" => ["{{WRAPPER}} .hl-table__container" => "border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};"]]); $this->start_controls_tabs("section_box_states"); $this->start_controls_tab("section_box_normal_state", ["label" => esc_html__("Normal", ASTAREH_WIDGETS_TEXTDOMAIN)]); $this->add_control("section_box_normal_background_color", ["label" => __("Background Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table__container" => "background-color: {{VALUE}}"]]); $this->add_group_control(Group_Control_Border::get_type(), ["name" => "section_box_normal_border", "selector" => "{{WRAPPER}} .hl-table__container"]); $this->add_control("section_box_normal_margin", ["label" => __("Margin", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table__container" => "margin-top:{{TOP}}{{UNIT}};margin-right: {{RIGHT}}{{UNIT}}; margin-bottom:{{BOTTOM}}{{UNIT}}; margin-left:{{LEFT}}{{UNIT}};"]]); $this->add_control("section_box_normal_padding", ["label" => __("Padding", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table__container" => "padding-top:{{TOP}}{{UNIT}};padding-right: {{RIGHT}}{{UNIT}}; padding-bottom:{{BOTTOM}}{{UNIT}}; padding-left:{{LEFT}}{{UNIT}};"]]); $this->end_controls_tab(); $this->start_controls_tab("section_box_hover_state", ["label" => esc_html__("Hover", ASTAREH_WIDGETS_TEXTDOMAIN)]); $this->add_control("section_box_hover_background_color", ["label" => __("Background Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table__container:hover" => "background-color: {{VALUE}}"]]); $this->add_group_control(Group_Control_Border::get_type(), ["name" => "section_box_hover_border", "selector" => "{{WRAPPER}} .hl-table__container:hover"]); $this->add_control("section_box_hover_margin", ["label" => __("Margin", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table__container:hover" => "margin-top:{{TOP}}{{UNIT}};margin-right: {{RIGHT}}{{UNIT}}; margin-bottom:{{BOTTOM}}{{UNIT}}; margin-left:{{LEFT}}{{UNIT}};"]]); $this->add_control("section_box_hover_padding", ["label" => __("Padding", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table__container:hover" => "padding-top:{{TOP}}{{UNIT}};padding-right: {{RIGHT}}{{UNIT}}; padding-bottom:{{BOTTOM}}{{UNIT}}; padding-left:{{LEFT}}{{UNIT}};"]]); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); } private function section_box_table() { $this->start_controls_section("section_box_table", ["label" => esc_html__("Table Box", ASTAREH_WIDGETS_TEXTDOMAIN), "tab" => Controls_Manager::TAB_STYLE]); $this->add_control("box_table_shadow", ["label" => __("Box Shadow", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::BOX_SHADOW, "selectors" => ["{{WRAPPER}} .hl-table" => "box-shadow: {{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{SPREAD}}px {{COLOR}};"], "default" => ["horizontal" => 0, "vertical" => 7, "blur" => 15, "spread" => 0, "color" => "#0000"]]); $this->add_control("box_table_border_radius", ["label" => __("Border Radius", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "%"], "selectors" => ["{{WRAPPER}} .hl-table" => "border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};"]]); $this->start_controls_tabs("box_table_states"); $this->start_controls_tab("box_table_normal_state", ["label" => esc_html__("Normal", ASTAREH_WIDGETS_TEXTDOMAIN)]); $this->add_control("box_table_normal_background_color", ["label" => __("Background Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table" => "background-color: {{VALUE}}"], "default" => "#fff"]); $this->add_group_control(Group_Control_Border::get_type(), ["name" => "box_table_normal_border", "selector" => "{{WRAPPER}} .hl-table"]); $this->add_control("box_table_normal_margin", ["label" => __("Margin", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table" => "margin-top:{{TOP}}{{UNIT}};margin-right: {{RIGHT}}{{UNIT}}; margin-bottom:{{BOTTOM}}{{UNIT}}; margin-left:{{LEFT}}{{UNIT}};"]]); $this->end_controls_tab(); $this->start_controls_tab("box_table_hover_state", ["label" => esc_html__("Hover", ASTAREH_WIDGETS_TEXTDOMAIN)]); $this->add_control("box_table_hover_background_color", ["label" => __("Background Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table:hover" => "background-color: {{VALUE}}"]]); $this->add_group_control(Group_Control_Border::get_type(), ["name" => "box_table_hover_border", "selector" => "{{WRAPPER}} .hl-table:hover"]); $this->add_control("box_table_hover_margin", ["label" => __("Margin", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table:hover" => "margin-top:{{TOP}}{{UNIT}};margin-right: {{RIGHT}}{{UNIT}}; margin-bottom:{{BOTTOM}}{{UNIT}}; margin-left:{{LEFT}}{{UNIT}};"]]); $this->add_control("box_table_hover_padding", ["label" => __("Padding", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table:hover" => "padding-top:{{TOP}}{{UNIT}};padding-right: {{RIGHT}}{{UNIT}}; padding-bottom:{{BOTTOM}}{{UNIT}}; padding-left:{{LEFT}}{{UNIT}};"]]); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); } private function section_header_plan() { $this->start_controls_section("section_header_plan", ["label" => esc_html__("Header Plan", ASTAREH_WIDGETS_TEXTDOMAIN), "tab" => Controls_Manager::TAB_STYLE]); $this->add_control("header_plan_normal_bg_color", ["label" => esc_html__("Background Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table__plan__item" => "background-color: {{VALUE}}"]]); $this->add_control("header_plan_justify_content", ["label" => esc_html__("Alignment", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::CHOOSE, "options" => ["right" => ["title" => esc_html__("Right", ASTAREH_WIDGETS_TEXTDOMAIN), "icon" => "eicon-text-align-right"], "center" => ["title" => esc_html__("Center", ASTAREH_WIDGETS_TEXTDOMAIN), "icon" => "eicon-text-align-center"], "left" => ["title" => esc_html__("Left", ASTAREH_WIDGETS_TEXTDOMAIN), "icon" => "eicon-text-align-left"]], "default" => "center", "toggle" => true, "selectors" => ["{{WRAPPER}} .hl-table__plan__item" => "justify-content: {{VALUE}};"]]); $this->add_group_control(Group_Control_Border::get_type(), ["name" => "header_plan_border", "selector" => "{{WRAPPER}} .hl-table__plan__item"]); $this->add_control("header_plan_margin", ["label" => __("Margin", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table__plan__item" => "margin-top:{{TOP}}{{UNIT}};margin-right: {{RIGHT}}{{UNIT}}; margin-bottom:{{BOTTOM}}{{UNIT}}; margin-left:{{LEFT}}{{UNIT}};"]]); $this->add_control("header_plan_padding", ["label" => __("Padding", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table__plan__item" => "padding-top:{{TOP}}{{UNIT}};padding-right: {{RIGHT}}{{UNIT}}; padding-bottom:{{BOTTOM}}{{UNIT}}; padding-left:{{LEFT}}{{UNIT}};"]]); $this->end_controls_section(); } private function section_plan_title() { $this->start_controls_section("section_plan_title", ["label" => esc_html__("Plan Title", ASTAREH_WIDGETS_TEXTDOMAIN), "tab" => Controls_Manager::TAB_STYLE]); $this->add_group_control(Group_Control_Typography::get_type(), ["name" => "plan_title_typography", "selector" => "{{WRAPPER}} .hl-table__plan__item__content .hl-table__plan__item__name"]); $this->add_control("plan_title_text_color", ["label" => __("Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table__plan__item__content .hl-table__plan__item__name" => "color: {{VALUE}}"]]); $this->add_control("plan_title_hover_text_color", ["label" => __("Hover Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table__plan__item__content .hl-table__plan__item__name:hover" => "color: {{VALUE}}"]]); $this->add_control("plan_title_margin", ["label" => __("Margin", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table__plan__item__content .hl-table__plan__item__name" => "margin-top:{{TOP}}{{UNIT}};margin-right: {{RIGHT}}{{UNIT}}; margin-bottom:{{BOTTOM}}{{UNIT}}; margin-left:{{LEFT}}{{UNIT}};"]]); $this->add_control("plan_title_padding", ["label" => __("Padding", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table__plan__item__content .hl-table__plan__item__name" => "padding-top:{{TOP}}{{UNIT}};padding-right: {{RIGHT}}{{UNIT}}; padding-bottom:{{BOTTOM}}{{UNIT}}; padding-left:{{LEFT}}{{UNIT}};"]]); $this->end_controls_section(); } private function section_plan_currency() { $this->start_controls_section("section_plan_currency", ["label" => esc_html__("Plan Currency", ASTAREH_WIDGETS_TEXTDOMAIN), "tab" => Controls_Manager::TAB_STYLE]); $this->add_group_control(Group_Control_Typography::get_type(), ["name" => "plan_currency_typography", "selector" => "{{WRAPPER}} .hl-table__plan__item__price__digit .hl-table__plan__item__price__currency"]); $this->add_control("plan_currency_normal_text_color", ["label" => __("Normal Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price__digit .hl-table__plan__item__price__currency" => "color: {{VALUE}}"]]); $this->add_control("plan_currency_hover_text_color", ["label" => __("Hover Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price__digit .hl-table__plan__item__price__currency:hover" => "color: {{VALUE}}"]]); $this->add_control("plan_currency_margin", ["label" => __("Margin", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price__digit .hl-table__plan__item__price__currency" => "margin-top:{{TOP}}{{UNIT}};margin-right: {{RIGHT}}{{UNIT}}; margin-bottom:{{BOTTOM}}{{UNIT}}; margin-left:{{LEFT}}{{UNIT}};"]]); $this->add_control("plan_currency_padding", ["label" => __("Padding", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price__digit .hl-table__plan__item__price__currency" => "padding-top:{{TOP}}{{UNIT}};padding-right: {{RIGHT}}{{UNIT}}; padding-bottom:{{BOTTOM}}{{UNIT}}; padding-left:{{LEFT}}{{UNIT}};"]]); $this->end_controls_section(); } private function section_plan_amount() { $this->start_controls_section("section_plan_amount", ["label" => esc_html__("Plan Amount", ASTAREH_WIDGETS_TEXTDOMAIN), "tab" => Controls_Manager::TAB_STYLE]); $this->add_group_control(Group_Control_Typography::get_type(), ["name" => "plan_amount_typography", "selector" => "{{WRAPPER}} .hl-table__plan__item__price .hl-table__plan__item__price__number"]); $this->add_control("plan_amount_text_color", ["label" => __("Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price .hl-table__plan__item__price__number" => "color: {{VALUE}}"]]); $this->add_control("plan_amount_hover_text_color", ["label" => __("Hover Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price:hover .hl-table__plan__item__price__number" => "color: {{VALUE}}"]]); $this->add_control("plan_amount_margin", ["label" => __("Margin", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price .hl-table__plan__item__price__number" => "margin-top:{{TOP}}{{UNIT}};margin-right: {{RIGHT}}{{UNIT}}; margin-bottom:{{BOTTOM}}{{UNIT}}; margin-left:{{LEFT}}{{UNIT}};"]]); $this->add_control("plan_amount_padding", ["label" => __("Padding", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price .hl-table__plan__item__price__number" => "padding-top:{{TOP}}{{UNIT}};padding-right: {{RIGHT}}{{UNIT}}; padding-bottom:{{BOTTOM}}{{UNIT}}; padding-left:{{LEFT}}{{UNIT}};"]]); $this->end_controls_section(); } private function section_plan_date_type() { $this->start_controls_section("section_plan_date", ["label" => esc_html__("Plan Date", ASTAREH_WIDGETS_TEXTDOMAIN), "tab" => Controls_Manager::TAB_STYLE]); $this->add_group_control(Group_Control_Typography::get_type(), ["name" => "plan_date_typography", "selector" => "{{WRAPPER}} .hl-table__plan__item__price__digit .hl-table__plan__item__price__date"]); $this->add_control("plan_date_text_color", ["label" => __("Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price__digit .hl-table__plan__item__price__date" => "color: {{VALUE}}"]]); $this->add_control("plan_date_hover_text_color", ["label" => __("Hover Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price__digit .hl-table__plan__item__price__date:hover" => "color: {{VALUE}}"]]); $this->add_control("plan_date_margin", ["label" => __("Margin", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price__digit .hl-table__plan__item__price__date" => "margin-top:{{TOP}}{{UNIT}};margin-right: {{RIGHT}}{{UNIT}}; margin-bottom:{{BOTTOM}}{{UNIT}}; margin-left:{{LEFT}}{{UNIT}};"]]); $this->add_control("plan_date_padding", ["label" => __("Padding", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price__digit .hl-table__plan__item__price__date" => "padding-top:{{TOP}}{{UNIT}};padding-right: {{RIGHT}}{{UNIT}}; padding-bottom:{{BOTTOM}}{{UNIT}}; padding-left:{{LEFT}}{{UNIT}};"]]); $this->end_controls_section(); } private function section_order_button() { $this->start_controls_section("section_order_button", ["label" => esc_html__("Order Button", ASTAREH_WIDGETS_TEXTDOMAIN), "tab" => Controls_Manager::TAB_STYLE]); $this->add_group_control(Group_Control_Typography::get_type(), ["name" => "order_button_typography", "selector" => "{{WRAPPER}} .hl-table__plan__item__price__link .hl-table__plan__item__price__btn"]); $this->add_control("order_button_justify_content", ["label" => esc_html__("Alignment", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::CHOOSE, "options" => ["right" => ["title" => esc_html__("Right", ASTAREH_WIDGETS_TEXTDOMAIN), "icon" => "eicon-text-align-right"], "center" => ["title" => esc_html__("Center", ASTAREH_WIDGETS_TEXTDOMAIN), "icon" => "eicon-text-align-center"], "left" => ["title" => esc_html__("Left", ASTAREH_WIDGETS_TEXTDOMAIN), "icon" => "eicon-text-align-left"]], "default" => "center", "toggle" => true, "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price__link .hl-table__plan__item__price__btn" => "justify-content: {{VALUE}};"]]); $this->add_group_control(Group_Control_Border::get_type(), ["name" => "order_button_border", "selector" => "{{WRAPPER}} .hl-table__plan__item__price__link .hl-table__plan__item__price__btn"]); $this->add_control("order_button_width", ["label" => esc_html__("Button width", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::SLIDER, "devices" => ["desktop", "tablet", "mobile"], "size_units" => ["px", "%", "em", "rem"], "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price__link .hl-table__plan__item__price__btn" => "width: {{SIZE}}{{UNIT}};"], "default" => ["unit" => "%"]]); $this->add_control("order_button_height", ["label" => esc_html__("Button Height", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::SLIDER, "devices" => ["desktop", "tablet", "mobile"], "size_units" => ["px", "%", "em", "rem"], "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price__link .hl-table__plan__item__price__btn" => "height: {{SIZE}}{{UNIT}};"], "default" => ["unit" => "px"]]); $this->add_control("order_button_margin", ["label" => __("Margin", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price__link .hl-table__plan__item__price__btn" => "margin-top:{{TOP}}{{UNIT}};margin-right: {{RIGHT}}{{UNIT}}; margin-bottom:{{BOTTOM}}{{UNIT}}; margin-left:{{LEFT}}{{UNIT}};"]]); $this->add_control("order_button_padding", ["label" => __("Padding", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price__link .hl-table__plan__item__price__btn" => "padding-top:{{TOP}}{{UNIT}};padding-right: {{RIGHT}}{{UNIT}}; padding-bottom:{{BOTTOM}}{{UNIT}}; padding-left:{{LEFT}}{{UNIT}};"]]); $this->add_control("order_button_border_radius", ["label" => __("Border Radius", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "%"], "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price__link .hl-table__plan__item__price__btn" => "border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};"]]); $this->start_controls_tabs("order_button_states"); $this->start_controls_tab("order_button_normal_state", ["label" => esc_html__("Normal", ASTAREH_WIDGETS_TEXTDOMAIN)]); $this->add_control("order_button_normal_text_color", ["label" => esc_html__("Text Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price__link .hl-table__plan__item__price__btn" => "color: {{VALUE}}"]]); $this->add_control("order_button_normal_bg_color", ["label" => esc_html__("Background Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table__plan__item__price__link .hl-table__plan__item__price__btn" => "background-color: {{VALUE}}"]]); $this->add_control("order_button_normal_box_shadow", ["label" => esc_html__("Box Shadow", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::BOX_SHADOW, "selectors" => ["{{WRAPPER}} .hl-table__plan__item .hl-table__plan__item__price__btn" => "box-shadow: {{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{SPREAD}}px {{COLOR}};"], "default" => ["horizontal" => 0, "vertical" => 0, "blur" => 20, "spread" => 0, "color" => "rgba@, , 0, 0)"]]); $this->end_controls_tab(); $this->start_controls_tab("order_button_hover_state", ["label" => esc_html__("Hover", ASTAREH_WIDGETS_TEXTDOMAIN)]); $this->add_control("order_button_hover_text_color", ["label" => esc_html__("Text Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table__plan__item:hover .hl-table__plan__item__price__btn" => "color: {{VALUE}}", "{{WRAPPER}} .hl-table__plan__item__price__btn:hover" => "color: unset !important;"]]); $this->add_control("order_button_hover_bg_color", ["label" => esc_html__("Background Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table__plan__item:hover .hl-table__plan__item__price__btn" => "background-color: {{VALUE}}", "{{WRAPPER}} .hl-table__plan__item__price__btn:hover" => "background-color: unset !important;"]]); $this->add_control("order_button_hover_box_shadow", ["label" => esc_html__("Box Shadow", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::BOX_SHADOW, "selectors" => ["{{WRAPPER}} .hl-table__plan__item:hover .hl-table__plan__item__price__btn" => "box-shadow: {{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{SPREAD}}px {{COLOR}};"], "default" => ["horizontal" => 0, "vertical" => 7, "blur" => 15, "spread" => 0, "color" => "rgba(, , 1, 0r0)"]]); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); } private function section_body_plan() { $this->start_controls_section("section_body_plan", ["label" => esc_html__("Body Plan", ASTAREH_WIDGETS_TEXTDOMAIN), "tab" => Controls_Manager::TAB_STYLE]); $this->start_controls_tabs("style_tabs"); $this->start_controls_tab("body_plan_th", ["label" => esc_html__("Table Header", ASTAREH_WIDGETS_TEXTDOMAIN)]); $this->add_group_control(Group_Control_Typography::get_type(), ["name" => "body_plan_th_typography", "selector" => "{{WRAPPER}} tbody .hl-table__body__th p"]); $this->add_control("body_plan_th_text_color", ["label" => __("Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} tbody .hl-table__body__th" => "color: {{VALUE}}"]]); $this->add_control("body_plan_th_bg_color_odd", ["label" => esc_html__("Background Color Odd", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table tbody>tr:nth-child(odd)>th" => "background-color: {{VALUE}} !important"]]); $this->add_control("body_plan_th_bg_color_even", ["label" => esc_html__("Background Color Even", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table tbody>tr:nth-child(even)>th" => "background-color: {{VALUE}} !important"]]); $this->add_control("body_plan_th_justify_content", ["label" => esc_html__("Alignment", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::CHOOSE, "options" => ["right" => ["title" => esc_html__("Right", ASTAREH_WIDGETS_TEXTDOMAIN), "icon" => "eicon-text-align-right"], "center" => ["title" => esc_html__("Center", ASTAREH_WIDGETS_TEXTDOMAIN), "icon" => "eicon-text-align-center"], "left" => ["title" => esc_html__("Left", ASTAREH_WIDGETS_TEXTDOMAIN), "icon" => "eicon-text-align-left"]], "default" => "center", "toggle" => true, "selectors" => ["{{WRAPPER}} tbody .hl-table__body__th" => "text-align: {{VALUE}};"]]); $this->add_group_control(Group_Control_Border::get_type(), ["name" => "body_plan_th_border", "selector" => "{{WRAPPER}} tbody .hl-table__body__th"]); $this->add_control("body_plan_th_padding", ["label" => __("Padding", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} tbody .hl-table__body__th" => "padding-top:{{TOP}}{{UNIT}};padding-right: {{RIGHT}}{{UNIT}}; padding-bottom:{{BOTTOM}}{{UNIT}}; padding-left:{{LEFT}}{{UNIT}};"]]); $this->end_controls_tab(); $this->start_controls_tab("body_plan_td", ["label" => esc_html__("Table Row", ASTAREH_WIDGETS_TEXTDOMAIN)]); $this->add_group_control(Group_Control_Typography::get_type(), ["name" => "body_plan_td_typography", "selector" => "{{WRAPPER}} tbody .hl-table__body__td p"]); $this->add_control("body_plan_td_text_color", ["label" => __("Color", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} tbody .hl-table__body__td" => "color: {{VALUE}}"]]); $this->add_control("body_plan_td_bg_color_odd", ["label" => esc_html__("Background Color Odd", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table tbody>tr:nth-child(odd)>td" => "background-color: {{VALUE}} !important"]]); $this->add_control("body_plan_td_bg_color_even", ["label" => esc_html__("Background Color Even", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::COLOR, "selectors" => ["{{WRAPPER}} .hl-table tbody>tr:nth-child(even)>td" => "background-color: {{VALUE}} !important"]]); $this->add_control("body_plan_td_justify_content", ["label" => esc_html__("Alignment", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::CHOOSE, "options" => ["right" => ["title" => esc_html__("Right", ASTAREH_WIDGETS_TEXTDOMAIN), "icon" => "eicon-text-align-right"], "center" => ["title" => esc_html__("Center", ASTAREH_WIDGETS_TEXTDOMAIN), "icon" => "eicon-text-align-center"], "left" => ["title" => esc_html__("Left", ASTAREH_WIDGETS_TEXTDOMAIN), "icon" => "eicon-text-align-left"]], "default" => "center", "toggle" => true, "selectors" => ["{{WRAPPER}} tbody .hl-table__body__td" => "text-align: {{VALUE}};"]]); $this->add_group_control(Group_Control_Border::get_type(), ["name" => "body_plan_td_border", "selector" => "{{WRAPPER}} tbody .hl-table__body__td"]); $this->add_control("body_plan_td_padding", ["label" => __("Padding", ASTAREH_WIDGETS_TEXTDOMAIN), "type" => Controls_Manager::DIMENSIONS, "size_units" => ["px", "rem", "em"], "selectors" => ["{{WRAPPER}} tbody .hl-table__body__td" => "padding-top:{{TOP}}{{UNIT}};padding-right: {{RIGHT}}{{UNIT}}; padding-bottom:{{BOTTOM}}{{UNIT}}; padding-left:{{LEFT}}{{UNIT}};"]]); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); $selected_categories = $settings["service_selected_terms"]; $query_args = ["order_by" => $settings["services_order_by"] ?? "ID", "order" => $settings["services_order"] ?? "DESC", "posts_per_page" => $settings["services_posts_per_category"] ?? -1, "post_status" => $settings["services_post_status"] ?? "publish"]; $excluded_posts = $settings["services_excluded_posts"]; if (empty($excluded_posts)) { goto O918449880345; } goto O475705859098; O918449880345: goto O844598366044; O475705859098: goto O473551757844; O844598366044: goto O184065255597; O473551757844: $excluded_posts = explode(" ", $excluded_posts); $query_args["post__not_in"] = $excluded_posts; O184065255597: $categories_data = $this->getCategoryDetails($selected_categories, $query_args); $repeater_values = []; $monthly_text = $settings["service_monthly_text"] ?? ''; $price_btn_text = $settings["service_order_plan_text"] ?? ''; $yearly_text = $settings["service_yearly_text"] ?? ''; $post_date_type = $settings["services_post_date_type"] ?? ''; $data_slider_id = $this->get_id(); echo " "; if (empty($categories_data)) { goto O856023053181; } goto O196542348812; O856023053181: goto O712571524171; O196542348812: goto O399275835536; O712571524171: goto O147217475862; O399275835536: echo " <section>
\xd\xa <div class="hl-table__container hl-drag__to__scroll d-flex overflow-auto">\xd\xa <table class="hl-table mx-4">\xd
<thead class="hl-table__header">
<tr>\xd
<th class="hl-table__header__th">
\xa </th>
"; foreach ($categories_data as $category) { echo " "; foreach ($category["posts"] as $post) { $currency_separator = MetaboxController::getMetaValue("service-currency-separator", true, ",", $post->ID); $price_btn_link = MetaboxController::getMetaValue("service-link", true, "#", $post->ID); $price_currency = MetaboxController::getMetaValue("service-currency", true, ",", $post->ID); $monthly_price = number_format((float) MetaboxController::getMetaValue("service-monthly-price", true, "0", $post->ID), 0, '', $currency_separator); $yearly_price = number_format((float) MetaboxController::getMetaValue("service-yearly-price", true, "0", $post->ID), 0, '', $currency_separator); $repeater_values[] = MetaboxController::getMetaValue("service-attribute-repeater", true, '', $post->ID); if ($post_date_type == "yearly") { goto O369826624752; } goto O563963489461; O369826624752: goto O039888911077; O563963489461: goto O531391448427; O039888911077: goto O088750503818; O531391448427: $price_number = $monthly_price; $price_date = $monthly_text; goto O052233570750; O088750503818: $price_number = $yearly_price; $price_date = $yearly_text; O052233570750: echo " <th class="hl-table__header__th">\xd
<div class="hl-table__plan__item">
\xa <div class="hl-table__plan__item__content">\xd
<h5 class="hl-table__plan__item__name">
"; echo esc_html($post->post_title); echo " </h5>
\xa <div class="hl-table__plan__item__price">\xd\xa <p class="hl-table__plan__item__price__number">\xd\xa "; echo esc_html__($price_number); echo " </p>
\xa <div class="hl-table__plan__item__price__digit">
\xa <p class="hl-table__plan__item__price__currency">
\xa "; echo esc_html__($price_currency); echo " </p>\xd
<p class="hl-table__plan__item__price__date">\xd\xa "; echo esc_html__($price_date); echo " </p>
</div>\xd
</div>
<a href=""; echo $price_btn_link; echo ""
\xa class="hl-table__plan__item__price__link">
<button type="button" class="hl-table__plan__item__price__btn">
\xa "; echo esc_html__($price_btn_text); echo " </button>
\xa </a>
\xa </div>
\xa </div>
\xa </th>\xd
"; O614348858020: O875428140678: O351370205801: O240741347282: O600965782181: } O122398856491: O481042128590: O829045236133: O701633171752: O074977296334: echo " "; O809751912019: O502444623607: O298984804338: O145466438414: O238951067325: } O420765088859: O045058154676: O507718910162: O483066085303: O892427342967: echo " </tr>\xd
</thead>
\xa <tbody>
"; $result_title = array_column($repeater_values, "service-attr-title"); $result_title = array_merge([], ...$result_title); $result_title = array_unique($result_title); $result_desc = array_column($repeater_values, "service-attr-desc"); $attributes = array_map(function ($index, $title) use($result_desc) { return ["title" => $title, "description" => array_column($result_desc, $index)]; }, array_keys($result_title), $result_title); echo " "; foreach ($attributes as $attribute) { echo " <tr>\xd
<th class="hl-table__body__th">\xd
<p> "; echo esc_html__($attribute["title"]); echo " </p>\xd\xa </th>
"; foreach ($attribute["description"] as $description) { echo " <td class="hl-table__body__td">\xd
<p> "; echo esc_html__($description); echo " </p>
\xa </td>
"; O649546962694: O821914732768: O440068620549: O309097116247: O404324464460: } O173177856635: O486188609908: O388179069332: O950168872032: O527591279122: echo " </tr>
\xa "; O591560645912: O011547411023: O583044182996: O078324475273: O603008283816: } O025024327233: O110974497470: O211089319968: O879313662471: O643818863350: echo " </tbody>\xd
</table>
\xa </div>\xd\xa </section>
\xa "; O147217475862: echo " "; } protected function getCategoryDetails($categories, $args = []) { $categories_data = []; $post_type_slug = PostTypeController::getServicePostTypeSlug(); $post_type_taxonomy_slug = PostTypeController::getServiceCategoryTaxonomySlug(); if (empty($categories)) { goto O455350793125; } goto O046780154978; O455350793125: goto O388701475389; O046780154978: goto O889993143700; O388701475389: goto O022190608386; O889993143700: foreach ($categories as $category_id) { $category_detail = get_term($category_id, $post_type_taxonomy_slug, ARRAY_A); $custom_query_args = ["post_type" => $post_type_slug, "tax_query" => [["taxonomy" => $post_type_taxonomy_slug, "field" => "term_id", "terms" => $category_id]]]; $custom_query_args = array_merge($custom_query_args, $args); $query_result = new WP_Query($custom_query_args); if (!(empty($category_detail) || is_wp_error($category_detail) || is_wp_error($query_result) || !$query_result->have_posts())) { goto O761345045396; } goto O031236070395; O761345045396: goto O832043328191; O031236070395: goto O785715775502; O832043328191: goto O548726744321; O785715775502: goto O403981443156; O548726744321: $category_detail = array_merge($category_detail, ["posts" => $query_result->posts]); array_push($categories_data, $category_detail); O403981443156: O021859473415: O120133035870: O153433062103: O545327323876: } O228351105203: O608957310851: O666633649933: O035888938920: O199277927368: O022190608386: return $categories_data; } }
© 2023 Quttera Ltd. All rights reserved.