File: /mnt/data/dreamspos-uk/wp-content/plugins/dreamslanding-widgets/widgets/class-dl-benefits.php
<?php
namespace Dreamslandingelementor\Widgets;
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Repeater;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class DTS_dl_benefits extends Widget_Base {
public function get_name() {
return 'dreamslanding_dl_benefits';
}
public function get_title() {
return __( 'DL Benefits', 'dreamslanding_elementor' );
}
public function get_icon() {
return 'eicon-bullet-list';
}
public function get_categories() {
return [ 'dreamslandingelemetortheme' ];
}
public function get_script_depends() {
return [ 'dreamslandingelementor-elementor' ];
}
protected function register_controls() {
$this->start_controls_section(
'section_content',
[
'label' => __( 'Content', 'dreamslanding_elementor' ),
]
);
$this->add_control(
'title',
[
'label' => __( 'Section Title', 'dreamslanding_elementor' ),
'type' => Controls_Manager::TEXT,
'default' => __( 'Benefits of Store Management Software for Business Owners', 'dreamslanding_elementor' ),
]
);
$this->add_control(
'button_text',
[
'label' => __( 'Button Text', 'dreamslanding_elementor' ),
'type' => Controls_Manager::TEXT,
'default' => __( 'Explore All', 'dreamslanding_elementor' ),
]
);
$this->add_control(
'button_url',
[
'label' => __( 'Button URL', 'dreamslanding_elementor' ),
'type' => Controls_Manager::URL,
'default' => [ 'url' => '#' ],
]
);
$repeater = new Repeater();
$repeater->add_control(
'number',
[
'label' => __( 'Number', 'dreamslanding_elementor' ),
'type' => Controls_Manager::TEXT,
'default' => '01',
]
);
$repeater->add_control(
'item_title',
[
'label' => __( 'Item Title', 'dreamslanding_elementor' ),
'type' => Controls_Manager::TEXT,
'default' => __( 'Unified Business Command Center', 'dreamslanding_elementor' ),
]
);
$repeater->add_control(
'item_description',
[
'label' => __( 'Item Description', 'dreamslanding_elementor' ),
'type' => Controls_Manager::TEXTAREA,
'default' => __( 'One dashboard, complete control. Eliminate spreadsheets and disconnected tools. Monitor sales, inventory, and operations in real-time from any device. Save 12+ hours weekly on admin tasks while making faster, data-backed decisions.', 'dreamslanding_elementor' ),
]
);
$repeater->add_control(
'item_url',
[
'label' => __( 'Item Link URL', 'dreamslanding_elementor' ),
'type' => Controls_Manager::URL,
'default' => [ 'url' => '#' ],
]
);
$this->add_control(
'benefit_items',
[
'label' => __( 'Benefit Items', 'dreamslanding_elementor' ),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'default' => [
[
'number' => '01',
'item_title' => __( 'Unified Business Command Center', 'dreamslanding_elementor' ),
'item_description' => __( 'One dashboard, complete control. Eliminate spreadsheets and disconnected tools. Monitor sales, inventory, and operations in real-time from any device. Save 12+ hours weekly on admin tasks while making faster, data-backed decisions.', 'dreamslanding_elementor' ),
'item_url' => [ 'url' => '#' ],
],
[
'number' => '02',
'item_title' => __( 'Profit-Driving Intelligence', 'dreamslanding_elementor' ),
'item_description' => __( 'Know what makes money, instantly. Live analytics reveal your bestsellers, peak hours, and profit margins. Spot trends before competitors do. Optimize pricing and inventory based on actual performance, not guesswork.', 'dreamslanding_elementor' ),
'item_url' => [ 'url' => '#' ],
],
[
'number' => '03',
'item_title' => __( 'Revenue-Protecting Speed & Accuracy', 'dreamslanding_elementor' ),
'item_description' => __( 'Every second costs money. Process transactions 3x faster than traditional methods. Accept every payment type customers want. Eliminate costly human errors that drain profits. Serve more customers during peak hours—directly increasing daily revenue.', 'dreamslanding_elementor' ),
'item_url' => [ 'url' => '#' ],
],
[
'number' => '04',
'item_title' => __( 'Labor Cost Optimization', 'dreamslanding_elementor' ),
'item_description' => __( 'Control your biggest expense. Automated scheduling prevents understaffing and costly overtime. GPS time-tracking stops time theft. Performance metrics identify top performers. Reduce labor costs by 15% while improving service quality.', 'dreamslanding_elementor' ),
'item_url' => [ 'url' => '#' ],
],
],
'title_field' => '{{{ number }}} - {{{ item_title }}}',
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
$title = ! empty( $settings['title'] ) ? $settings['title'] : __( 'Benefits of Store Management Software for Business Owners', 'dreamslanding_elementor' );
$button_text = ! empty( $settings['button_text'] ) ? $settings['button_text'] : __( 'Explore All', 'dreamslanding_elementor' );
$button_url = ! empty( $settings['button_url']['url'] ) ? $settings['button_url']['url'] : '#';
?>
<!-- Benefits Section -->
<section class="benefit-section">
<div class="container">
<div class="section-header">
<div class="row align-items-center">
<div class="col-md-8 aos" data-aos="fade-up">
<h2><?php echo esc_html( $title ); ?></h2>
</div>
<div class="col-md-4 aos" data-aos="fade-up">
<div class="benefit-btn">
<a href="<?php echo esc_url( $button_url ); ?>" class="main-btn">
<span class="btn-primary"><?php echo esc_html( $button_text ); ?></span>
<b class="secondary-arrow"><i class="ti ti-arrow-up-right"></i></b>
</a>
</div>
</div>
</div>
</div>
</div>
<div class="benefit-bg">
<div class="benefit-flex">
<?php
if ( ! empty( $settings['benefit_items'] ) && is_array( $settings['benefit_items'] ) ) {
foreach ( $settings['benefit_items'] as $item ) {
$number = isset( $item['number'] ) ? $item['number'] : '';
$item_title = isset( $item['item_title'] ) ? $item['item_title'] : '';
$desc = isset( $item['item_description'] ) ? $item['item_description'] : '';
$item_url = isset( $item['item_url']['url'] ) && $item['item_url']['url'] ? $item['item_url']['url'] : '#';
if ( ! $item_title && ! $desc ) {
continue;
}
?>
<div class="benefit-grid aos" data-aos="fade-up">
<div class="benefit-content">
<div class="benefit-info">
<div class="benefit-wrap">
<div class="benefit-text">
<?php if ( $number ) : ?>
<h2><?php echo esc_html( $number ); ?></h2>
<?php endif; ?>
<?php if ( $item_title ) : ?>
<h4><?php echo esc_html( $item_title ); ?></h4>
<?php endif; ?>
<?php if ( $desc ) : ?>
<p><?php echo esc_html( $desc ); ?></p>
<?php endif; ?>
</div>
</div>
</div>
<div class="benefit-arrow">
<a href="<?php echo esc_url( $item_url ); ?>" class="d-flex align-items-center justify-content-center">
<i class="ti ti-arrow-up-right"></i>
</a>
</div>
</div>
</div>
<?php
}
}
?>
</div>
</div>
</section>
<!-- /Benefits Section -->
<?php
}
}