-
Notifications
You must be signed in to change notification settings - Fork 34
/
cart-tab.php
executable file
·92 lines (81 loc) · 2.08 KB
/
cart-tab.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
/**
* Plugin Name: WooCommerce Cart Tab
* Plugin URI: http://jameskoster.co.uk/tag/cart-tab/
* Version: 1.1.2
* Description: Displays a sitewide link to the cart which reveals the cart contents on hover.
* Author: jameskoster
* Tested up to: 4.9.6
* Author URI: http://jameskoster.co.uk
* Text Domain: woocommerce-cart-tab
* Domain Path: /languages/
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*
* @package woocommerce-cart-tab
*/
/**
* Check if WooCommerce is active
**/
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ) ) {
/**
* Localisation
*/
load_plugin_textdomain( 'woocommerce-cart-tab', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
if ( ! class_exists( 'WooCommerce_Cart_Tab' ) ) {
/**
* Cart Tab class
*/
class WooCommerce_Cart_Tab {
/**
* The token.
*
* @var string
* @access public
* @since 1.1.1
*/
public $token;
/**
* The version number.
*
* @var string
* @access public
* @since 1.1.1
*/
public $version;
/**
* Set up all the things
*/
public function __construct() {
$this->token = 'woocommerce-cart-tab';
$this->version = '1.1.2';
$this->setup();
register_activation_hook( __FILE__, array( $this, 'install' ) );
}
/**
* Installation.
* Runs on activation. Logs the version number.
*
* @access public
* @since 1.1.1
* @return void
*/
public function install() {
update_option( $this->token . '-version', $this->version );
}
/**
* Setup
*
* @return void
*/
public function setup() {
include_once( 'includes/cart-tab-functions.php' );
include_once( 'includes/cart-tab-templates.php' );
include_once( 'includes/class-cart-tab-customizer.php' );
include_once( 'includes/class-cart-tab-frontend.php' );
include_once( 'includes/class-cart-tab-hooks.php' );
}
}
$woocommerce_cart_tab = new WooCommerce_Cart_Tab();
}
}