<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}
if ( ! class_exists( 'Draly_Dropshipping_Starter_Pluggable_Compe_Woo_Compare_Products' ) ) {
	class Draly_Dropshipping_Starter_Pluggable_Compe_Woo_Compare_Products {
		/**
		 * Variable to hold the initialization state.
		 *
		 * @var  boolean
		 */
		protected static $initialized = false;

		public static function initialize() {
			// Do nothing if pluggable functions already initialized.
			if ( self::$initialized ) {
				return;
			}
			add_action( 'woocommerce_after_add_to_cart_button', array( __CLASS__, 'draly_dropshipping_starter_render_compare_button' ), 5 );
			add_action( 'draly_dropshipping_starter_function_shop_loop_item_compare', array( __CLASS__, 'draly_dropshipping_starter_render_compare_button' ), 1 );
			// State that initialization completed.
			self::$initialized = true;
		}

		public static function draly_dropshipping_starter_render_compare_button() {
			echo do_shortcode( '[wpc_sc_single]' );
		}
	}
}