<?php

namespace Webnestors\Wsn\Snippets;

class GeneralEstimatedDeliveryDates extends \Webnestors\Wsn\Snippet {
    public $estimated_days = "Estimeted Days";

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

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

    public function title() : string {
        return esc_html__( "Estimated Delivery Dates", "enhancements-for-woocommerce" );
    }

    public function description() : string {
        return esc_html__( "Show the estimated days for delivery. After enabling this, go to WooCommerce > Settings > Shipping, and edit the shipping method you like. You will find a new field called (Days to Deliver) where you can use the number of days the order will take to arrive with that shipping method. After that you will see in the cart and in the checkout page that the days were automatically calculated and shows the date of the delivery", "enhancements-for-woocommerce" );
    }

    public function meta() : array {
        return [[
            "label"       => esc_html__( "Estimated Delivery Prefix", "enhancements-for-woocommerce" ),
            "description" => esc_html__( "For example, (Estimated Delivery Date:)", "enhancements-for-woocommerce" ),
            "name"        => "estimated_days",
            "type"        => "text",
        ]];
    }

    public function tooltip() : ?string {
        ob_start();
        ?>
        <h1><strong><?php 
        echo esc_html( $this->title() );
        ?></strong></h1>
        <h3>Description</h3>
        <p>The Estimated Delivery Dates module enhances your WooCommerce store by providing a precise and user-friendly way to display estimated delivery dates for each shipping method. This feature automatically calculates and displays the expected delivery date based on the specific number of days associated with each shipping method. Once enabled, you can easily configure delivery times by going to WooCommerce > Settings > Shipping and editing the shipping method. A new field, called Days to Deliver, allows you to enter the estimated number of days that a particular shipping method will take to deliver an order.</p>
        <p>This module calculates and displays the estimated delivery date dynamically at the cart and checkout pages, ensuring that customers have a clear understanding of when they can expect their orders. This transparency helps set customer expectations, builds trust, and can lead to increased satisfaction and fewer support inquiries regarding shipping times.</p>
        <h3>Settings</h3>
        <p><a href="/wp-admin/admin.php?page=wc-settings&tab=shipping" target="_blank">Go to settings</a> so that you can start adding the days to deliver for each shipping method</p>
        <h4>Estimated Delivery Prefix</h4>
        <p>You can write here text that will be displayed before the dynamic date</p>
        <h3>Appearance</h3>
        <p>You can customize the appearence of the module by using custom css and the class "wn_est_delivery".</p>
        <?php 
        return ob_get_clean();
    }

    public function run() {
    }

    function wn_init() {
    }

    function wn_create_shipping_method_days_field( $fields ) {
    }

    function wn_create_days_as_meta( $args, $method ) {
    }

    function wn_output_shipping_method_tooltips( $method ) {
    }

}
