Added Icons to WC plugin checkout page
This commit is contained in:
@@ -18,6 +18,11 @@ if (!defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
// Define plugin constants
|
||||
define('ALUXPAY_PLUGIN_FILE', __FILE__);
|
||||
define('ALUXPAY_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
||||
define('ALUXPAY_PLUGIN_URL', plugin_dir_url(__FILE__));
|
||||
|
||||
// Declare HPOS compatibility
|
||||
add_action('before_woocommerce_init', function() {
|
||||
if (class_exists(\Automattic\WooCommerce\Utilities\FeaturesUtil::class)) {
|
||||
@@ -25,6 +30,24 @@ add_action('before_woocommerce_init', function() {
|
||||
}
|
||||
});
|
||||
|
||||
// Include the gateway class
|
||||
add_action('plugins_loaded', 'aluxpay_init_gateway');
|
||||
|
||||
function aluxpay_init_gateway() {
|
||||
if (!class_exists('WC_Payment_Gateway')) {
|
||||
return;
|
||||
}
|
||||
|
||||
require_once ALUXPAY_PLUGIN_DIR . 'includes/class-aluxpay-payment-gateway.php';
|
||||
|
||||
add_filter('woocommerce_payment_gateways', 'aluxpay_add_gateway');
|
||||
}
|
||||
|
||||
function aluxpay_add_gateway($gateways) {
|
||||
$gateways[] = 'WC_AluxPay_Payment_Gateway';
|
||||
return $gateways;
|
||||
}
|
||||
|
||||
// Define plugin constants
|
||||
define('CPG_VERSION', '1.1.0');
|
||||
define('CPG_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
||||
|
||||
Reference in New Issue
Block a user