start_controls_section( 'section_items', [ 'label' => __( 'Price List', 'admore-widgets-suite' ), ] ); $repeater = new \Elementor\Repeater(); $repeater->add_control( 'title', [ 'label' => __( 'Title', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'Item Name', 'admore-widgets-suite' ), 'label_block' => true, 'dynamic' => [ 'active' => true ], ] ); $repeater->add_control( 'description', [ 'label' => __( 'Description', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'default' => __( 'A brief description of this item.', 'admore-widgets-suite' ), 'rows' => 2, 'dynamic' => [ 'active' => true ], ] ); $repeater->add_control( 'price', [ 'label' => __( 'Price', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => '$12.99', 'label_block' => false, 'dynamic' => [ 'active' => true ], ] ); $repeater->add_control( 'badge', [ 'label' => __( 'Badge Label', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'placeholder' => __( 'e.g. Popular, New, Vegan', 'admore-widgets-suite' ), 'label_block' => false, ] ); $repeater->add_control( 'badge_color', [ 'label' => __( 'Badge Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'condition' => [ 'badge!' => '' ], ] ); $repeater->add_control( 'image', [ 'label' => __( 'Image', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::MEDIA, 'separator' => 'before', 'dynamic' => [ 'active' => true ], ] ); $repeater->add_control( 'link', [ 'label' => __( 'Link', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::URL, 'dynamic' => [ 'active' => true ], ] ); $this->add_control( 'items', [ 'label' => __( 'Items', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'title' => __( 'Margherita Pizza', 'admore-widgets-suite' ), 'description' => __( 'Classic tomato, mozzarella and fresh basil.', 'admore-widgets-suite' ), 'price' => '$14.99', 'badge' => __( 'Popular', 'admore-widgets-suite' ) ], [ 'title' => __( 'Caesar Salad', 'admore-widgets-suite' ), 'description' => __( 'Crispy romaine, parmesan and house dressing.', 'admore-widgets-suite' ), 'price' => '$9.99', 'badge' => '' ], [ 'title' => __( 'Grilled Salmon', 'admore-widgets-suite' ), 'description' => __( 'Atlantic salmon with lemon butter sauce.', 'admore-widgets-suite' ), 'price' => '$22.99', 'badge' => __( 'New', 'admore-widgets-suite' ) ], [ 'title' => __( 'Chocolate Lava Cake', 'admore-widgets-suite' ), 'description' => __( 'Warm chocolate cake with vanilla ice cream.', 'admore-widgets-suite' ), 'price' => '$7.99', 'badge' => '' ], ], 'title_field' => '{{{ title }}} — {{{ price }}}', ] ); $this->end_controls_section(); /* ── Layout ── */ $this->start_controls_section( 'section_layout', [ 'label' => __( 'Layout', 'admore-widgets-suite' ), ] ); $this->add_control( 'layout', [ 'label' => __( 'Layout', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'list', 'options' => [ 'list' => __( 'List', 'admore-widgets-suite' ), 'grid' => __( 'Grid', 'admore-widgets-suite' ), ], ] ); $this->add_responsive_control( 'columns', [ 'label' => __( 'Columns', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => '2', 'options' => [ '1' => '1', '2' => '2', '3' => '3', '4' => '4' ], 'condition' => [ 'layout' => 'grid' ], 'selectors' => [ '{{WRAPPER}} .eppro-price-list--grid' => 'grid-template-columns: repeat({{VALUE}}, 1fr);' ], ] ); $this->add_control( 'show_image', [ 'label' => __( 'Show Image', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', ] ); $this->add_responsive_control( 'image_width', [ 'label' => __( 'Image Width', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 40, 'max' => 200 ] ], 'default' => [ 'size' => 80, 'unit' => 'px' ], 'condition' => [ 'show_image' => 'yes' ], 'selectors' => [ '{{WRAPPER}} .eppro-pl-image' => 'width: {{SIZE}}{{UNIT}}; min-width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .eppro-pl-image img' => 'width: 100%;', ], ] ); $this->add_control( 'image_position', [ 'label' => __( 'Image Position', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'left', 'options' => [ 'left' => __( 'Left', 'admore-widgets-suite' ), 'right' => __( 'Right', 'admore-widgets-suite' ), ], 'condition' => [ 'show_image' => 'yes', 'layout' => 'list' ], ] ); $this->add_control( 'show_divider', [ 'label' => __( 'Dotted Divider', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', 'separator' => 'before', ] ); $this->end_controls_section(); /* ── Style: Items ── */ $this->start_controls_section( 'section_style_item', [ 'label' => __( 'Item', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'item_bg', 'selector' => '{{WRAPPER}} .eppro-pl-item', ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'item_border', 'selector' => '{{WRAPPER}} .eppro-pl-item', ] ); $this->add_responsive_control( 'item_border_radius', [ 'label' => __( 'Border Radius', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .eppro-pl-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->add_responsive_control( 'item_padding', [ 'label' => __( 'Padding', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em' ], 'default' => [ 'top' => '16', 'right' => '0', 'bottom' => '16', 'left' => '0', 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .eppro-pl-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->add_responsive_control( 'item_gap', [ 'label' => __( 'Gap Between Items', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 48 ] ], 'default' => [ 'size' => 0 ], 'selectors' => [ '{{WRAPPER}} .eppro-price-list' => 'gap: {{SIZE}}px;' ], ] ); $this->add_control( 'separator_color', [ 'label' => __( 'Separator Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#e5e7eb', 'selectors' => [ '{{WRAPPER}} .eppro-pl-item:not(:last-child)' => 'border-bottom-color: {{VALUE}};' ], 'separator' => 'before', ] ); $this->end_controls_section(); /* ── Style: Typography ── */ $this->start_controls_section( 'section_style_typo', [ 'label' => __( 'Typography', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'label' => __( 'Title', 'admore-widgets-suite' ), 'selector' => '{{WRAPPER}} .eppro-pl-title', ] ); $this->add_control( 'title_color', [ 'label' => __( 'Title Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-pl-title, {{WRAPPER}} .eppro-pl-title a' => 'color: {{VALUE}};' ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'desc_typography', 'label' => __( 'Description', 'admore-widgets-suite' ), 'selector' => '{{WRAPPER}} .eppro-pl-desc', 'separator' => 'before', ] ); $this->add_control( 'desc_color', [ 'label' => __( 'Description Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-pl-desc' => 'color: {{VALUE}};' ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'price_typography', 'label' => __( 'Price', 'admore-widgets-suite' ), 'selector' => '{{WRAPPER}} .eppro-pl-price', 'separator' => 'before', ] ); $this->add_control( 'price_color', [ 'label' => __( 'Price Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => EPPRO_Elementor_Helper::brand_color(), 'selectors' => [ '{{WRAPPER}} .eppro-pl-price' => 'color: {{VALUE}};' ], ] ); $this->end_controls_section(); /* ── Style: Badge ── */ $this->start_controls_section( 'section_style_badge', [ 'label' => __( 'Badge', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'badge_default_bg', [ 'label' => __( 'Default Background', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => EPPRO_Elementor_Helper::brand_color(), 'selectors' => [ '{{WRAPPER}} .eppro-pl-badge' => 'background-color: {{VALUE}};' ], ] ); $this->add_control( 'badge_text_color', [ 'label' => __( 'Text Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .eppro-pl-badge' => 'color: {{VALUE}};' ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'badge_typography', 'selector' => '{{WRAPPER}} .eppro-pl-badge', ] ); $this->end_controls_section(); /* ── Style: Image ── */ $this->start_controls_section( 'section_style_image', [ 'label' => __( 'Image', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'condition' => [ 'show_image' => 'yes' ], ] ); $this->add_responsive_control( 'image_border_radius', [ 'label' => __( 'Border Radius', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'default' => [ 'top' => '6', 'right' => '6', 'bottom' => '6', 'left' => '6', 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .eppro-pl-image img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->end_controls_section(); $this->eppro_register_entrance_animation_controls(); } // ------------------------------------------------------------------------- // Render // ------------------------------------------------------------------------- protected function render(): void { $s = $this->get_settings_for_display(); $items = $s['items'] ?? []; $layout = $s['layout'] ?? 'list'; $show_img = 'yes' === ( $s['show_image'] ?? 'yes' ); $img_pos = $s['image_position'] ?? 'left'; $show_div = 'yes' === ( $s['show_divider'] ?? 'yes' ); if ( empty( $items ) ) return; $list_class = 'eppro-price-list eppro-price-list--' . esc_attr( $layout ); ?>
> >