woocommerce-advanced-ordernumbers.php 1.49 KB
Newer Older
1 2
<?php
/**
3 4
 * Plugin Name: Woocommerce Advanced Ordernumbers
 * Plugin URI: http://open-tools.net/woocommerce/advanced-ordernumbers-for-woocommerce.html
5
 * Description: Lets the user freely configure the order numbers in WooCommerce.
6
 * Version: 1.1
7
 * Author: Open Tools
8 9 10 11 12 13 14 15 16 17 18
 * Author URI: http://open-tools.net
 * Text Domain: woocommerce-advanced-ordernumbers
 * Domain Path: 
 * License: GPL2+
 WC requires at least: 2.2
WC tested up to: 2.3
*/

if ( ! defined( 'ABSPATH' ) ) { 
	exit; // Exit if accessed directly
}
19 20 21 22 23
// Define a global flag so the basic plugin can deactivate itself if this plugin is loaded
if ( !defined('OPENTOOLS_ADVANCED_ORDERNUMBERS') ) {
	define ('OPENTOOLS_ADVANCED_ORDERNUMBERS', true);
}

24 25 26 27 28
/**
 * Check if WooCommerce is active
 **/
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {

29
	if (file_exists(plugin_dir_path( __FILE__ ) . '/ordernumbers_woocommerce.php') && !class_exists("OpenToolsOrdernumbers")) {
30
		require_once( plugin_dir_path( __FILE__ ) . '/ordernumbers_woocommerce.php');
31 32 33
	} 
	if (!class_exists("OpenToolsOrdernumbersBasic"))
		require_once( plugin_dir_path( __FILE__ ) . '/ordernumbers_woocommerce_basic.php');
34

35 36

	// instantiate the plugin class
37
	if (class_exists("OpenToolsOrdernumbers")) {
38 39 40
		$ordernumber_plugin = new OpenToolsOrdernumbers(plugin_basename(__FILE__));
	} elseif (class_exists("OpenToolsOrdernumbersBasic")) {
		$ordernumber_plugin = new OpenToolsOrdernumbersBasic(plugin_basename(__FILE__));
41
	}
42

43 44
 
}