<?php

namespace Webnestors\Wsn\Snippets;

class CheckoutAddShippingPhone extends \Webnestors\Wsn\Snippet {
    public $shipping_phone = "";

    public $required = false;

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

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

    public function title() : string {
        return esc_html__( "Add a Shipping Phone Field", "enhancements-for-woocommerce" );
    }

    public function description() : string {
        return esc_html__( "Adds a new field for the shipping section where customer can add the phone number of the recipient.", "enhancements-for-woocommerce" );
    }

    public function meta() : array {
        return [[
            "label" => esc_html__( "Field Label", "enhancements-for-woocommerce" ),
            "name"  => "shipping_phone",
            "type"  => "text",
        ], [
            "label" => esc_html__( "Required", "enhancements-for-woocommerce" ),
            "name"  => "required",
            "type"  => "checkbox",
        ]];
    }

    public function tooltip() : ?string {
        ob_start();
        ?>
        <h1><strong><?php 
        echo esc_html( $this->title() );
        ?></strong></h1>
        <h3>Description</h3>
        <p>The Add a Shipping Phone Field module introduces a dedicated phone number field in the shipping section of the WooCommerce checkout. This allows customers to enter the recipient’s phone number specifically for shipping purposes, separate from the billing phone number. This feature is particularly useful for ensuring that delivery personnel have the correct contact information for the recipient, making the delivery process smoother and more efficient.</p>
        <p>For businesses that frequently ship to third-party recipients or require a separate contact number for logistical purposes, this module is an ideal solution to collect all necessary details.</p>
        <h3>Settings</h3>
        <h4>Field Label</h4>
        <p>Write the label that you want to appear</p>
        <h4>Required</h4>
        <p>Check it if you want the field to be required</p>
        <h3>Appearance</h3>
        <p>There are no appearence options for this module</p>
        <?php 
        return ob_get_clean();
    }

    public function run() {
    }

    function wn_add_shipping_phone( $fields ) {
    }

    function wn_show_shipping_phone( $order ) {
    }

    function wn_add_shipping_phone_to_email( $fields, $sent_to_admin, $order ) {
    }

}
