• Resolved Shams Raju

    (@shamsraju)


    Can anyone tell me please how to use condition in repeater field with outside repeater field?

    • This topic was modified 1 year, 9 months ago by Shams Raju.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi,

    Can you send me your site URL, please?

    Thread Starter Shams Raju

    (@shamsraju)

    It’s under my local host server. I want to attach an image here, but I can’t do it.

    Thread Starter Shams Raju

    (@shamsraju)

    protected function register_controls() {
    
      // Pricing Table
    
      $this -> start_controls_section(
    
        'pricing_table',
    
        [
    
          'label' => esc_html__('Pricing Table', 'elementor-addon'),
    
          'tab'   => \Elementor\Controls_Manager::TAB_CONTENT,
    
        ]
    
      );
    
        $this -> add_control(
    
          'pricing_section_layout',
    
          [
    
            'label'       => esc_html__('Layout', 'elementor-addon'),
    
            'type'        => \Elementor\Controls_Manager::SELECT,
    
            'default'     => 'style_one',
    
            'options' => [
    
              'style_one' => esc_html__('Style 1', 'elementor-addon'),
    
              'style_two' => esc_html__('Style 2', 'elementor-addon'),
    
            ],
    
          ]
    
        );
    
        $this -> add_control(
    
          'pricing_table_data',
    
          [
    
            'label'  => esc_html__('Pricing Items', 'elementor-addon'),
    
            'type'   => \Elementor\Controls_Manager::REPEATER,
    
            'fields' => [
    
              [
    
                'name'        => 'pricing_package_title',
    
                'label'       => esc_html__('Title', 'elementor-addon'),
    
                'type'        => \Elementor\Controls_Manager::TEXT,
    
                'default'     => esc_html__('Standard' , 'elementor-addon'),
    
                'placeholder' => esc_html__('Type pricing package title', 'elementor-addon'),
    
              ],
    
              [
    
                'name'        => 'pricing_package_items',
    
                'label'       => esc_html__('Items', 'elementor-addon'),
    
                'type'        => \Elementor\Controls_Manager::WYSIWYG,
    
                'default'     => esc_html__('Far far away.'),
    
                'placeholder' => esc_html__('Type package items here', 'elementor-addon'),
    
                'condition'   => [
    
                  'pricing_section_layout' => 'style_two',
    
                ]
    
              ],
    
            ],
    
            'title_field' => 'pricing_package_title',
    
          ]
    
        );
    
      $this -> end_controls_section();
    
    }
    Thread Starter Shams Raju

    (@shamsraju)

    I want to use condition under ‘pricing_table_data’ repeater field in ‘pricing_package_items’ with outside of repeater field ‘pricing_section_layout’.

    So, when I use style_two option in elementor dashboard then I want to show ‘pricing_package_items’ field, otherwise it should be hidden.

    Do you have Elementor pro on your site?

    Thread Starter Shams Raju

    (@shamsraju)

    Not on this website. but I have pro version.

    Can you elaborate on your request, please?

    Add some screenshots, please.

    Thread Starter Shams Raju

    (@shamsraju)

    When I use style_two option in elementor dashboard then I want to show ‘pricing_package_items’ field, otherwise it should be hidden.

    • This reply was modified 1 year, 9 months ago by Shams Raju.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to use condition in repeater field? (Widget Development)’ is closed to new replies.