PluginProbe
MakeCommerce for WooCommerce / 3.0.12
MakeCommerce for WooCommerce v3.0.12
4.1.0 4.0.8 trunk 1.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.0 2.2.1 2.2.2 All 96 releases
makecommerce / includes / activator.php

activator.php in MakeCommerce for WooCommerce 3.0.12, at includes/activator.php

81 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace MakeCommerce;
4
5 /**
6 * Fired during plugin activation.
7 *
8 * This class defines all code necessary to run during the plugin's activation.
9 *
10 * @since 3.0.0
11 * @package Makecommerce
12 * @subpackage Makecommerce/includes
13 * @author Maksekeskus AS <support@maksekeskus.ee>
14 */
15
16 class Activator {
17
18 /**
19 * Short Description. (use period)
20 *
21 * Long Description.
22 *
23 * @since 3.0.0
24 */
25 public static function activate() {
26
27 self::create_tables();
28
29 }
30
31 /**
32 * Creates db tables.
33 *
34 * @since 3.0.12
35 */
36 public static function create_tables() {
37 global $wpdb;
38
39 //Create table if it doesn't already exist
40 $wpdb->query
41 ("
42 CREATE TABLE IF NOT EXISTS
43 `" . $wpdb->prefix . MAKECOMMERCE_TABLENAME . "`
44 (
45 `id` mediumint(9) NOT NULL AUTO_INCREMENT,
46 `type` varchar(10) NOT NULL,
47 `country` char(2) NOT NULL,
48 `name` varchar(25) NOT NULL,
49 `url` varchar(250) NOT NULL,
50 `logo_url` varchar(250),
51 `channel` varchar(250),
52 `display_name` varchar(250),
53 `min_amount` mediumint(9),
54 `max_amount` mediumint(9),
55 PRIMARY KEY `id` (`id`)
56 )
57 " . $wpdb->get_charset_collate() . ";
58 ");
59
60 //Create sco table if it doesn't already exist
61 $wpdb->query
62 ("
63 CREATE TABLE IF NOT EXISTS
64 `" . $wpdb->prefix . MAKECOMMERCE_SCO_TABLENAME . "`
65 (
66 `id` int(11) unsigned not null auto_increment,
67 `cart_id` varchar(64) not null default '',
68 `order_id` int(10) unsigned not null,
69 `created` int(10) unsigned not null,
70 `modified` int(10) unsigned not null,
71 `status` tinyint unsigned not null,
72 `content` mediumtext,
73 primary key id (`id`),
74 key `cart_id` (`cart_id`)
75 )
76 " . $wpdb->get_charset_collate() . ";
77 ");
78 }
79
80 }
81