<?php

namespace Webnestors\Wsn\Snippets;

class GeneralAddShippingInfo extends \Webnestors\Wsn\Snippet {
    public $shipping_heading = "Estimated Time";

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

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

    public function title() : string {
        return __( "Add Shipping Info to Products", "enhancements-for-woocommerce" );
    }

    public function description() : string {
        return __( "Show shipping info to every product and display it on the single product page and the product archives. On the product edit page, you will see a new field called Shipping Info. There, fill in your info text, for example, (4 - 5 days). The Shipping info is combined with the prefix text below. So if you write the prefix (Estimated delivery),  you will get (Estimated Delivery 4- 5 days)", "enhancements-for-woocommerce" );
    }

    public function meta() : array {
        return [[
            "label"       => __( "Prefix Text", "enhancements-for-woocommerce" ),
            "description" => __( "Shipping info prefix text.", "enhancements-for-woocommerce" ),
            "name"        => "shipping_heading",
            "type"        => "text",
        ]];
    }

    public function tooltip() : ?string {
        ob_start();
        ?>
        <h1><strong><?php 
        echo esc_html( $this->title() );
        ?></strong></h1>
        <h3>Description</h3>
        <p>The Add Shipping Info to Products module allows WooCommerce store owners to provide clear, customized shipping information directly on product pages and product archives, enhancing the overall user experience and transparency for customers.</p>
        <p>When enabled, this module adds a new field called Shipping Info within the product edit page. Here, store owners can enter the specific shipping details for each product. This field is highly flexible, allowing you to input any type of shipping-related information, such as "4-5 days," "Free Shipping," or "Ships in 24 hours." Additionally, you can combine this info with a customizable prefix text, such as "Estimated Delivery," "Shipping Time," or "Shipping Info." This prefix will automatically append to the shipping details, creating a seamless and professional display on the front-end. For example, if you set the prefix as "Estimated Delivery" and enter "4-5 days" in the shipping info field, the product page will display: "Estimated Delivery: 4-5 days."</p>
        <h3>Settings</h3>
        <h4>Prefix Text</h4>
        <p>Write the prefix that with combined with the text on the product you will get the whole sentence</p>
        <p>After enabling the module go to product edit page and place the text that you like on each product, <a href="/wp-admin/edit.php?post_type=product" target="_blank">PRODUCT EDIT PAGE</a></p>
        <h3>Attention</h3>
        <p>This module works only fot simple product, if you have other product types like variable then you will not see the field</p>
        <h3>Tip</h3>
        <p>If you leave the prefix text empty you will display only what you place on each product</p>
        <h3>Appearance</h3>
        <p>The appearence of the shipping info module is based on the standard WooCommerce Message Appearence, you can modify this look via your theme (if your theme supports the customization) or custom css using the class "woocommerce-message".</p>
        <?php 
        return ob_get_clean();
    }

    public function run() {
    }

    function wn_add_text_field() {
    }

    function wn_save_field( $product ) {
    }

    function wn_display_shipping_info() {
    }

}
