<?php

namespace Webnestors\Wsn\Snippets;

class SingleBadgeCountdown extends \Webnestors\Wsn\Snippet {
    public $text_counter = "Sales";

    public function is_pro() : bool {
        return true;
    }

    public function tab() : string {
        return "product";
    }

    public function title() : string {
        return esc_html__( "Turn Sales Badge to a Countdown", "enhancements-for-woocommerce" );
    }

    public function description() : string {
        return esc_html__( "Replace the sales badge with a countdown timer. Products must have a schedule end date.", "enhancements-for-woocommerce" );
    }

    public function meta() : array {
        return [[
            "label" => esc_html__( "Text Before Counter", "enhancements-for-woocommerce" ),
            "name"  => "text_counter",
            "type"  => "text",
        ]];
    }

    public function tooltip() : ?string {
        ob_start();
        ?>
        <h1><strong><?php 
        echo esc_html( $this->title() );
        ?></strong></h1>
        
        <h3>Description</h3>
        <p>The Turn Sales Badge to a Countdown module replaces the standard sales badge with a live countdown timer, displaying the time remaining until the sale ends. This feature automatically activates for products with a scheduled sale end date, allowing you to create a sense of urgency by visually showing the limited time left for the discount.</p>
        <p>Countdowns are a proven way to boost conversions by motivating customers to act quickly, making this module perfect for flash sales, seasonal discounts, or promotional events.</p>
        <h3>Settings</h3>
        <p>Write the text you want to display before the countdown timer.</p>
        <h3>Appearance</h3>
        <p>There are no customization options for this module.</p>
        <?php 
        return ob_get_clean();
    }

    public function run() {
    }

    function wn_sale_end_date( $html, $post, $product ) {
    }

}
