-
Notifications
You must be signed in to change notification settings - Fork 0
/
cproductfee.php
61 lines (51 loc) · 1.42 KB
/
cproductfee.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* Plugin Name: Codeable Product Fee
* Plugin URI: https://codeable.io/
* Description: Increases Woocommerce cart total by X% if a certain product is in the cart
* Version: 1.0.0
* Author: David Beja
* Author URI: https://codeable.io/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: cproductfee
*
* @package codeable-product-fee
*/
defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
if ( ! class_exists( 'CProductFee' ) ) :
define( 'CPRODUCTFEE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'CPRODUCTFEE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
/**
* Codeable Product Fee Main Class
*
* @author David Beja
*/
class CProductFee {
/**
* Plugin initialization
*/
public static function init() {
register_activation_hook( __FILE__, 'CProductFee::activate' );
register_deactivation_hook( __FILE__, 'CProductFee::deactivate' );
if ( is_admin() ) {
require_once( CPRODUCTFEE_PLUGIN_DIR . 'admin/class-cproductfee-admin.php' );
$admin = new CProductFee_Admin();
} else {
require_once( CPRODUCTFEE_PLUGIN_DIR . 'public/class-cproductfee-public.php' );
$public = new CProductFee_Public();
}
}
/**
* Activate hook
*/
public static function activate() {
}
/**
* Deactivate hook
*/
public static function deactivate() {
}
}
CProductFee ::init();
endif;