<?php

namespace Webnestors\Wsn\Snippets;

class CartMinOrderAmount extends \Webnestors\Wsn\Snippet {
    public $min_amount = "";

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

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

    public function title() : string {
        return esc_html__( "Minimum Order Amount", "enhancements-for-woocommerce" );
    }

    public function description() : string {
        return esc_html__( "Show a message for minimum order amount", "enhancements-for-woocommerce" );
    }

    public function meta() : array {
        return [[
            "label" => esc_html__( "Minimum Amount", "enhancements-for-woocommerce" ),
            "name"  => "min_amount",
            "type"  => "text",
        ]];
    }

    public function tooltip() : ?string {
        ob_start();
        ?>
        <h1><strong><?php 
        echo esc_html( $this->title() );
        ?></strong></h1>
        <h3>Description</h3>
        <p>The Minimum Order Amount module is designed to enforce a minimum purchase requirement in your WooCommerce store. This feature displays a customizable message informing customers about the minimum order amount they need to reach in order to proceed with their purchase. If the customer’s cart total is below this threshold, the module deactivates the "Proceed to Checkout" button, preventing them from checking out until they meet the minimum requirement. This ensures customers are aware of the policy and incentivizes them to add more items to their cart.</p>
        <p>This module is especially useful for stores with minimum order policies due to shipping costs, wholesale requirements, or other reasons. By clearly displaying the requirement and enforcing it, you can maintain your pricing strategy while providing customers with clear guidance on how to meet the purchase minimum.</p>
        <h3>Settings</h3>
        <h4>Minimum Amount</h4>
        <p>Write the minimum amount for the orders</p>
        <h3>Appearance</h3>
        <p>You can use custom css to customize the Appearance of the module, use the class "ul.woocommerce-error".</p>
        <?php 
        return ob_get_clean();
    }

    public function run() {
    }

    function wn_minimum_order_amount() {
    }

}
