<?php

namespace Inspire_Labs\Alsendo_Connect;

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

use WC_Shipping_Method;
use WC_Shipping_Rate;

/**
 * Shipping_Rates
 */
class Shipping_Rates {


	/**
	 * Initializes shipping rate display modifications.
	 *
	 * Adds action hook to modify shipping rate display for Alsendo Connect
	 * shipping methods after WooCommerce renders shipping rates.
	 *
	 * @return void
	 */
	public function init() {
		add_action(
			'woocommerce_after_shipping_rate',
			function ( $method, $index ) {
				/**
				 * @var WC_Shipping_Rate $method
				 */
				if ( strpos( $method->get_method_id(), 'alsendo_connect' ) === false ) {
					return;
				}
			},
			10,
			2
		);
	}
}
