PluginProbe
MakeCommerce for WooCommerce / 3.0.4
MakeCommerce for WooCommerce v3.0.4
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.4, at includes/activator.php

69 lines 1.5 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 global $wpdb;
28
29 //Create table if it doesn't already exist
30 $wpdb->query
31 ("
32 CREATE TABLE IF NOT EXISTS
33 `" . $wpdb->prefix . MAKECOMMERCE_TABLENAME . "`
34 (
35 `id` mediumint(9) NOT NULL AUTO_INCREMENT,
36 `type` varchar(10) NOT NULL,
37 `country` char(2) NOT NULL,
38 `name` varchar(25) NOT NULL,
39 `url` varchar(250) NOT NULL,
40 `logo_url` varchar(250),
41 `min_amount` mediumint(9),
42 `max_amount` mediumint(9),
43 UNIQUE KEY `id` (`id`)
44 )
45 " . $wpdb->get_charset_collate() . ";
46 ");
47
48 //Create sco table if it doesn't already exist
49 $wpdb->query
50 ("
51 CREATE TABLE IF NOT EXISTS
52 `" . $wpdb->prefix . MAKECOMMERCE_SCO_TABLENAME . "`
53 (
54 `id` int(11) unsigned not null auto_increment,
55 `cart_id` varchar(64) not null default '',
56 `order_id` int(10) unsigned not null,
57 `created` int(10) unsigned not null,
58 `modified` int(10) unsigned not null,
59 `status` tinyint unsigned not null,
60 `content` mediumtext,
61 unique key id (`id`),
62 key `cart_id` (`cart_id`)
63 )
64 " . $wpdb->get_charset_collate() . ";
65 ");
66 }
67
68 }
69