<?php

namespace Webnestors\Wsn\Snippets;

class AccountOrderAgainButton extends \Webnestors\Wsn\Snippet {
    public $button_text = "";

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

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

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

    public function description() : string {
        return esc_html__( "Enable this to add an order again button inside the Orders table on the (My account) page under section orders.", "enhancements-for-woocommerce" );
    }

    public function meta() : array {
        return [[
            "label"       => esc_html__( "Button Text", "enhancements-for-woocommerce" ),
            "description" => esc_html__( "Choose the text that will be shown. For example, 'Order Again'", "enhancements-for-woocommerce" ),
            "name"        => "button_text",
            "type"        => "text",
        ]];
    }

    public function tooltip() : ?string {
        $image_url = \Webnestors\Wsn\Plugin::instance()->get_url( "assets/images/order_again.png" );
        ob_start();
        ?>
        <h1><strong><?php 
        echo esc_html( $this->title() );
        ?></strong></h1>
        <img src="<?php 
        echo esc_url( $image_url );
        ?>">
        <h3>Description</h3>
        <p>The Order Again Button module adds a convenient "Order Again" button to the Orders table on the WooCommerce "My Account" page, allowing customers to quickly reorder items from their previous purchases with a single click. This feature enhances user experience by streamlining the reordering process, making it easy for returning customers to repurchase items they have previously ordered without navigating through the entire product catalog.</p>
        <p>This module is especially beneficial for stores with repeat customers or subscription-based models, as it encourages loyalty and simplifies the ordering process for products that are frequently purchased.</p>
        <h3>Settings</h3>
        <h4>Button Text</h4>
        <p>Choose the text that will be shown. For example, "Order Again"</p>
        <h3>Appearance</h3>
        <p>The are no appearence options for this module</p>
        <?php 
        return ob_get_clean();
    }

    public function run() {
    }

    function wn_order_again_button( $actions, $order ) {
    }

}
