<?php

namespace Webnestors\Wsn\Snippets;

use Webnestors\Wsn\Plugin;
class GeneralMultipleStockLocations extends \Webnestors\Wsn\Snippet {
    public $stock_location_1 = "";

    public $stock_location_2 = "";

    public $stock_location_3 = "";

    public $stock_location_4 = "";

    public $stock_location_5 = "";

    public $stock_location_6 = "";

    public $stock_location_7 = "";

    public $stock_location_8 = "";

    public $stock_location_9 = "";

    public $stock_location_10 = "";

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

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

    public function title() : string {
        return esc_html__( "Multiple Stock Locations", "enhancements-for-woocommerce" );
    }

    public function description() : string {
        return esc_html__( "Creates multiple stock locations for your stock management, place the name of the location you want, you do not have to name them all, only the locations that you need", "enhancements-for-woocommerce" );
    }

    public function meta() : array {
        return [
            [
                "label"       => __( "Stock Location 1", "enhancements-for-woocommerce" ),
                "description" => __( "Name Your Stock Location", "enhancements-for-woocommerce" ),
                "name"        => "stock_location_1",
                "type"        => "text",
            ],
            [
                "label"       => __( "Stock Location 2", "enhancements-for-woocommerce" ),
                "description" => __( "Name Your Stock Location", "enhancements-for-woocommerce" ),
                "name"        => "stock_location_2",
                "type"        => "text",
            ],
            [
                "label"       => __( "Stock Location 3", "enhancements-for-woocommerce" ),
                "description" => __( "Name Your Stock Location", "enhancements-for-woocommerce" ),
                "name"        => "stock_location_3",
                "type"        => "text",
            ],
            [
                "label"       => __( "Stock Location 4", "enhancements-for-woocommerce" ),
                "description" => __( "Name Your Stock Location", "enhancements-for-woocommerce" ),
                "name"        => "stock_location_4",
                "type"        => "text",
            ],
            [
                "label"       => __( "Stock Location 5", "enhancements-for-woocommerce" ),
                "description" => __( "Name Your Stock Location", "enhancements-for-woocommerce" ),
                "name"        => "stock_location_5",
                "type"        => "text",
            ],
            [
                "label"       => __( "Stock Location 6", "enhancements-for-woocommerce" ),
                "description" => __( "Name Your Stock Location", "enhancements-for-woocommerce" ),
                "name"        => "stock_location_6",
                "type"        => "text",
            ],
            [
                "label"       => __( "Stock Location 7", "enhancements-for-woocommerce" ),
                "description" => __( "Name Your Stock Location", "enhancements-for-woocommerce" ),
                "name"        => "stock_location_7",
                "type"        => "text",
            ],
            [
                "label"       => __( "Stock Location 8", "enhancements-for-woocommerce" ),
                "description" => __( "Name Your Stock Location", "enhancements-for-woocommerce" ),
                "name"        => "stock_location_8",
                "type"        => "text",
            ],
            [
                "label"       => __( "Stock Location 9", "enhancements-for-woocommerce" ),
                "description" => __( "Name Your Stock Location", "enhancements-for-woocommerce" ),
                "name"        => "stock_location_9",
                "type"        => "text",
            ],
            [
                "label"       => __( "Stock Location 10", "enhancements-for-woocommerce" ),
                "description" => __( "Name Your Stock Location", "enhancements-for-woocommerce" ),
                "name"        => "stock_location_10",
                "type"        => "text",
            ]
        ];
    }

    public function tooltip() : ?string {
        ob_start();
        ?>
        <h1><strong><?php 
        echo esc_html( $this->title() );
        ?></strong></h1>
        <h3>Description</h3>
        <p>The Multiple Stock Locations module enables advanced stock management by allowing you to create and manage multiple stock locations within WooCommerce. With this feature, you can assign specific quantities of stock to different locations, such as warehouses, stores, or distribution centers, for each product. This is especially useful for businesses with multiple outlets or fulfillment centers, as it provides greater control over inventory distribution and simplifies logistics.</p>
        <p>Rather than being required to define every location upfront, this module allows you to add only the locations you actually need, giving you flexibility and ease in managing your stock.</p>
        <h3>Settings</h3>
        <p>Name only the locations that you need, you can add up to 10 locations.</p>
        <h3>Usage</h3>
        <p><a href="/wp-admin/edit.php?post_type=product" target="_blank">PRODUCT EDIT PAGE</a> After you have added the locations, you can go to each product and assign the stock quantity for each location. Works for both simple and variable products.</p>
        <p>You can also check the stock quantity for each location in the order edit page.</p>
        <p>When an order is created, you will see a meta box with the stock quantity for each location. This will be with red color if the stock quantity is less than the total stock quantity of all locations. From there you can change the stock quantity for each location.</p>
        <h3>Appearance</h3>
        <p>There are no customization options for this module.</p>
        <?php 
        return ob_get_clean();
    }

    public function run() {
    }

    /**
     * Adds the "Stock Location Information" meta box to the order edit page.
     */
    public function add_stock_location_meta_box() {
    }

    /**
     * Displays the "Stock Location Information" meta box content.
     *
     * @param WP_Post|\WC_Order $post The current post object.
     */
    public function display_stock_location_meta_box( $post ) {
    }

    /**
     * Saves the stock location quantities when the order is updated.
     *
     * @param int $post_id The post ID of the order.
     * @param WP_Post $post The current post object.
     */
    public function save_stock_location_meta_box_data( $post_id, $post ) {
    }

    /**
     * Display stock location fields on the Inventory tab for simple products.
     */
    public function add_stock_location_fields() {
    }

    /**
     * Save stock location fields for simple products.
     */
    public function save_stock_location_fields( $post_id ) {
    }

    /**
     * Display stock location fields for each variation in the inventory tab.
     */
    public function add_stock_location_fields_to_variations( $loop, $variation_data, $variation ) {
    }

    /**
     * Save stock location fields for variable products' variations.
     */
    public function save_stock_location_fields_for_variations( $variation_id, $loop ) {
    }

}
