<?php
namespace Aventa;

use Elementor\Widget_Base;
use Elementor\Controls_Manager;

if ( ! defined( "ABSPATH" ) ) {
	exit; // Exit if accessed directly
}

class Rad_Cart_Widget extends Widget_Base {

	public function get_name() {
		return "rad-cart";
	}

	public function get_title() {
		return esc_html__( "Cart", "aventa" );
	}

	public function get_icon() {
		return "eicon-bag-light";
	}

	public function get_keywords() {
		return [ "woocommerce", "shop", "store", "cart", "aventa" ];
	}

	public function get_categories() {
		return [ Rad_Helpers::WC_WIDGETS_CATEGORY ];
	}

	protected function register_controls() {
    $this->start_controls_section(
      "section_content",
			[
				"label" => esc_html__( "Cart", "aventa" )
			]
    );

    $this->add_control(
			"wc_notice_frontpage",
			[
				"type" => Controls_Manager::RAW_HTML,
				"raw" => esc_html__( "There are no customization options available for this widget.", "aventa" ),
				"content_classes" => "elementor-panel-alert elementor-panel-alert-info"
			]
		);

    $this->end_controls_section();
	}

	protected function render() {
    $html = do_shortcode( "[woocommerce_cart]" );
    echo "$html";

		?><script>
			document.body.classList.add( "woocommerce-cart", "woocommerce-page" );
		</script><?php
	}

}
