get_settings_for_display( 'image' );
$heading = $this->get_settings_for_display( 'heading' );
$description = $this->get_settings_for_display( 'description' );
$slide_button_text = $this->get_settings_for_display( 'slide_button_text' );
$coupon_code = $this->get_settings_for_display( 'coupon_code' );
$button_link = $this->get_settings_for_display( 'button_link' );
$link_target = $this->get_settings_for_display( 'link_target' );
$details = $this->get_settings_for_display( 'details' );
$toggle_details = $this->get_settings_for_display( 'toggle_details' );
$button_text = $this->get_settings_for_display( 'button_text' );
$button_text_copied = $this->get_settings_for_display( 'button_text_copied' );
$show_icon = $this->get_settings_for_display( 'show_icon' );
$icon_direction = $this->get_settings_for_display( 'icon_direction' );
$display_slide_button = $this->get_settings_for_display( 'display_slide_button' );
$clicked = ( 'yes' === $display_slide_button ? '' : ' ctc-coupon-clicked' );
?>
Show Details' ;
}
echo '
' . wp_kses_post( wpautop( $details ) ) . '
' ;
?>
start_controls_section( 'image_section', [
'label' => esc_html__( 'Coupon Image', 'copy-the-code' ),
] );
$this->add_control( 'image', [
'label' => esc_html__( 'Coupon Image', 'copy-the-code' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
] );
$this->end_controls_section();
$this->start_controls_section( 'heading_section', [
'label' => esc_html__( 'Heading', 'copy-the-code' ),
] );
$this->add_control( 'heading', [
'label' => esc_html__( 'Heading', 'copy-the-code' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Up to 50% off', 'copy-the-code' ),
] );
$this->end_controls_section();
$this->start_controls_section( 'description_section', [
'label' => esc_html__( 'Short Description', 'copy-the-code' ),
] );
$this->add_control( 'description', [
'label' => esc_html__( 'Short Description', 'copy-the-code' ),
'type' => Controls_Manager::WYSIWYG,
'default' => 'Get up to 50% off on all products. Offer valid till 31st December 2020.',
] );
$this->end_controls_section();
$this->start_controls_section( 'coupon_button_section', [
'label' => esc_html__( 'Coupon Code', 'copy-the-code' ),
] );
$this->add_control( 'coupon_code', [
'label' => esc_html__( 'Coupon Code', 'copy-the-code' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'CTC30', 'copy-the-code' ),
] );
$this->add_control( 'display_slide_button', [
'label' => esc_html__( 'Display Slide Button', 'copy-the-code' ),
'type' => Controls_Manager::SWITCHER,
'default' => 'yes',
] );
// Button Text.
$this->add_control( 'slide_button_text', [
'label' => esc_html__( 'Slide Button Text', 'copy-the-code' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Show Coupon Code', 'copy-the-code' ),
'condition' => [
'display_slide_button' => 'yes',
],
] );
// Button Link.
$this->add_control( 'button_link', [
'label' => esc_html__( 'Button Link', 'copy-the-code' ),
'type' => Controls_Manager::URL,
'default' => [
'url' => '#',
],
'condition' => [
'display_slide_button' => 'yes',
],
] );
// Link target.
$this->add_control( 'link_target', [
'label' => esc_html__( 'Link Target', 'copy-the-code' ),
'type' => Controls_Manager::SELECT,
'default' => '_blank',
'options' => [
'_self' => esc_html__( 'Self', 'copy-the-code' ),
'_blank' => esc_html__( 'Blank', 'copy-the-code' ),
],
'condition' => [
'display_slide_button' => 'yes',
],
] );
$this->end_controls_section();
$this->start_controls_section( 'details_section', [
'label' => esc_html__( 'Details', 'copy-the-code' ),
] );
// Enable Toggle Details.
$this->add_control( 'toggle_details', [
'label' => esc_html__( 'Enable Toggle Details', 'copy-the-code' ),
'type' => Controls_Manager::SWITCHER,
'default' => 'yes',
] );
// Details.
$this->add_control( 'details', [
'label' => esc_html__( 'Details', 'copy-the-code' ),
'type' => Controls_Manager::WYSIWYG,
'default' => '- Get upto 50% off on all products.
-
Offer valid till 31st December 2020.
- No coupon code required.
',
] );
$this->end_controls_section();
/**
* Group - Copy Button
*/
$this->start_controls_section( 'button_section', [
'label' => esc_html__( 'Copy Button', 'copy-the-code' ),
] );
$this->add_control( 'button_text', [
'label' => esc_html__( 'Copy Button Text', 'copy-the-code' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Copy Code', 'copy-the-code' ),
] );
$this->add_control( 'button_text_copied', [
'label' => esc_html__( 'After Copy Button Text', 'copy-the-code' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Code Copied', 'copy-the-code' ),
] );
// Show Icon.
$this->add_control( 'show_icon', [
'label' => esc_html__( 'Show Icon', 'copy-the-code' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Show', 'copy-the-code' ),
'label_off' => esc_html__( 'Hide', 'copy-the-code' ),
'return_value' => 'yes',
'default' => 'yes',
] );
$this->add_control( 'icon_direction', [
'label' => esc_html__( 'Icon Direction', 'copy-the-code' ),
'type' => Controls_Manager::SELECT,
'default' => 'before',
'options' => [
'before' => esc_html__( 'Before', 'copy-the-code' ),
'after' => esc_html__( 'After', 'copy-the-code' ),
],
'condition' => [
'show_icon' => 'yes',
],
] );
$this->add_responsive_control( 'icon_text_gap', [
'label' => esc_html__( 'Icon and Text Gap', 'copy-the-code' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px', 'em' ],
'range' => [
'px' => [
'min' => 0,
'max' => 100,
],
'em' => [
'min' => 0,
'max' => 10,
],
],
'selectors' => [
'{{WRAPPER}} .ctc-with-icon' => 'gap: {{SIZE}}{{UNIT}};',
],
'condition' => [
'show_icon' => 'yes',
],
] );
$this->end_controls_section();
Helpers::register_pro_sections( $this, [
'Header',
'Heading',
'Description',
'Button',
'Coupon Code',
'Details',
'Details > Link',
'Details > Content'
] );
}
}