{"slug":"byticslab-conditional-offers-for-woocommerce","name":"ByticsLab Conditional Offers for WooCommerce","description":"A rule-driven conditional promotions engine for WooCommerce — Buy X Get Y, spend-based free gifts, category offers, and more.","author":"Bytics Lab","active_installs":0,"version":"1.0.5","wp_org_url":"https://wordpress.org/plugins/byticslab-conditional-offers-for-woocommerce/","is_closed":false,"cleanup":{"has_uninstall_hook":true,"drops_tables_on_uninstall":false,"deletes_options_on_uninstall":true},"tables":[{"table_name":"bcog_gift_selections","full_table_name":"wp_bcog_gift_selections","description":"Stores bcog gift selections data created by this plugin.","detection_method":"static","confidence":"high","columns":[{"name":"id","type":"BIGINT UNSIGNED","nullable":false,"primary_key":true},{"name":"session_key","type":"VARCHAR(64)","nullable":false,"primary_key":false},{"name":"promotion_id","type":"BIGINT UNSIGNED","nullable":false,"primary_key":false},{"name":"reward_id","type":"VARCHAR(64)","nullable":false,"primary_key":false},{"name":"product_id","type":"BIGINT UNSIGNED","nullable":true,"primary_key":false},{"name":"variation_id","type":"BIGINT UNSIGNED","nullable":true,"primary_key":false},{"name":"quantity","type":"INT","nullable":false,"primary_key":false},{"name":"status","type":"VARCHAR(20)","nullable":false,"primary_key":false},{"name":"updated_at","type":"DATETIME","nullable":false,"primary_key":false}],"create_sql":"CREATE TABLE wp_bcog_gift_selections ( id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, session_key VARCHAR(64) NOT NULL, promotion_id BIGINT UNSIGNED NOT NULL, reward_id VARCHAR(64) NOT NULL, product_id BIGINT UNSIGNED NULL DEFAULT NULL, variation_id BIGINT UNSIGNED NULL DEFAULT NULL, quantity INT NOT NULL DEFAULT 1, status VARCHAR(20) NOT NULL DEFAULT 'selected', updated_at DATETIME NOT NULL, PRIMARY KEY (id), UNIQUE KEY bcog_selection_unique (session_key, promotion_id, reward_id), KEY session_promotion (session_key, promotion_id), KEY updated_at (updated_at) ) ENGINE"},{"table_name":"bcog_promotion_counters","full_table_name":"wp_bcog_promotion_counters","description":"Stores bcog promotion counters data created by this plugin.","detection_method":"static","confidence":"high","columns":[{"name":"promotion_id","type":"BIGINT UNSIGNED","nullable":false,"primary_key":false},{"name":"scope","type":"VARCHAR(20)","nullable":false,"primary_key":false},{"name":"subject_hash","type":"VARCHAR(64)","nullable":false,"primary_key":false},{"name":"bucket_start","type":"DATETIME","nullable":false,"primary_key":false},{"name":"reserved_count","type":"BIGINT UNSIGNED","nullable":false,"primary_key":false}],"create_sql":"CREATE TABLE wp_bcog_promotion_counters ( promotion_id BIGINT UNSIGNED NOT NULL, scope VARCHAR(20) NOT NULL, subject_hash VARCHAR(64) NOT NULL, bucket_start DATETIME NOT NULL, reserved_count BIGINT UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (promotion_id, scope, subject_hash, bucket_start) ) ENGINE"},{"table_name":"bcog_promotion_index","full_table_name":"wp_bcog_promotion_index","description":"Stores bcog promotion index data created by this plugin.","detection_method":"static","confidence":"high","columns":[{"name":"id","type":"BIGINT UNSIGNED","nullable":false,"primary_key":true},{"name":"promotion_id","type":"BIGINT UNSIGNED","nullable":false,"primary_key":false},{"name":"object_id","type":"BIGINT UNSIGNED","nullable":true,"primary_key":false},{"name":"lookup_key","type":"VARCHAR(191)","nullable":false,"primary_key":false},{"name":"role","type":"VARCHAR(20)","nullable":false,"primary_key":false}],"create_sql":"CREATE TABLE wp_bcog_promotion_index ( id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, promotion_id BIGINT UNSIGNED NOT NULL, index_type VARCHAR(20) NOT NULL, object_id BIGINT UNSIGNED NULL DEFAULT NULL, lookup_key VARCHAR(191) NOT NULL, role VARCHAR(20) NOT NULL, PRIMARY KEY (id), UNIQUE KEY bcog_idx_unique (promotion_id, lookup_key, role), KEY index_type_object_role (index_type, object_id, role), KEY lookup_key_role (lookup_key, role), KEY promotion_id (promotion_id) ) ENGINE"},{"table_name":"bcog_promotions","full_table_name":"wp_bcog_promotions","description":"Stores bcog promotions data created by this plugin.","detection_method":"static","confidence":"high","columns":[{"name":"id","type":"BIGINT UNSIGNED","nullable":false,"primary_key":true},{"name":"name","type":"VARCHAR(255)","nullable":false,"primary_key":false},{"name":"status","type":"VARCHAR(20)","nullable":false,"primary_key":false},{"name":"type","type":"VARCHAR(50)","nullable":false,"primary_key":false},{"name":"priority","type":"INT","nullable":false,"primary_key":false},{"name":"conditions","type":"LONGTEXT","nullable":false,"primary_key":false},{"name":"rewards","type":"LONGTEXT","nullable":false,"primary_key":false},{"name":"settings","type":"LONGTEXT","nullable":false,"primary_key":false},{"name":"starts_at","type":"DATETIME","nullable":true,"primary_key":false},{"name":"ends_at","type":"DATETIME","nullable":true,"primary_key":false},{"name":"usage_count","type":"BIGINT UNSIGNED","nullable":false,"primary_key":false},{"name":"created_at","type":"DATETIME","nullable":false,"primary_key":false},{"name":"updated_at","type":"DATETIME","nullable":false,"primary_key":false},{"name":"created_by","type":"BIGINT UNSIGNED","nullable":false,"primary_key":false}],"create_sql":"CREATE TABLE wp_bcog_promotions ( id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL, status VARCHAR(20) NOT NULL DEFAULT 'draft', type VARCHAR(50) NOT NULL, priority INT NOT NULL DEFAULT 10, conditions LONGTEXT NOT NULL, rewards LONGTEXT NOT NULL, settings LONGTEXT NOT NULL, starts_at DATETIME NULL DEFAULT NULL, ends_at DATETIME NULL DEFAULT NULL, usage_count BIGINT UNSIGNED NOT NULL DEFAULT 0, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, created_by BIGINT UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (id), KEY status_priority (status, priority), KEY starts_ends (starts_at, ends_at) ) ENGINE"},{"table_name":"bcog_usage_log","full_table_name":"wp_bcog_usage_log","description":"A logging table that records activity, events, or audit history.","detection_method":"static","confidence":"high","columns":[{"name":"id","type":"BIGINT UNSIGNED","nullable":false,"primary_key":true},{"name":"promotion_id","type":"BIGINT UNSIGNED","nullable":false,"primary_key":false},{"name":"order_id","type":"BIGINT UNSIGNED","nullable":true,"primary_key":false},{"name":"customer_id","type":"BIGINT UNSIGNED","nullable":true,"primary_key":false},{"name":"customer_hash","type":"VARCHAR(64)","nullable":true,"primary_key":false},{"name":"reward_snapshot","type":"LONGTEXT","nullable":true,"primary_key":false},{"name":"used_at","type":"DATETIME","nullable":false,"primary_key":false},{"name":"released_at","type":"DATETIME","nullable":true,"primary_key":false}],"create_sql":"CREATE TABLE wp_bcog_usage_log ( id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, promotion_id BIGINT UNSIGNED NOT NULL, order_id BIGINT UNSIGNED NULL DEFAULT NULL, customer_id BIGINT UNSIGNED NULL DEFAULT NULL, customer_hash VARCHAR(64) NULL DEFAULT NULL, reward_snapshot LONGTEXT NULL, used_at DATETIME NOT NULL, released_at DATETIME NULL DEFAULT NULL, PRIMARY KEY (id), UNIQUE KEY bcog_usage_unique (promotion_id, order_id), KEY promotion_customer (promotion_id, customer_id), KEY promotion_customer_hash (promotion_id, customer_hash), KEY order_id (order_id) ) ENGINE"},{"table_name":"bcog_usage_reservations","full_table_name":"wp_bcog_usage_reservations","description":"Stores bcog usage reservations data created by this plugin.","detection_method":"static","confidence":"high","columns":[{"name":"id","type":"BIGINT UNSIGNED","nullable":false,"primary_key":true},{"name":"promotion_id","type":"BIGINT UNSIGNED","nullable":false,"primary_key":false},{"name":"reservation_key","type":"CHAR(64)","nullable":false,"primary_key":false},{"name":"scope","type":"VARCHAR(20)","nullable":false,"primary_key":false},{"name":"subject_hash","type":"VARCHAR(64)","nullable":false,"primary_key":false},{"name":"bucket_start","type":"DATETIME","nullable":false,"primary_key":false},{"name":"status","type":"VARCHAR(20)","nullable":false,"primary_key":false},{"name":"order_id","type":"BIGINT UNSIGNED","nullable":true,"primary_key":false},{"name":"reserved_at","type":"DATETIME","nullable":false,"primary_key":false},{"name":"expires_at","type":"DATETIME","nullable":false,"primary_key":false},{"name":"confirmed_at","type":"DATETIME","nullable":true,"primary_key":false},{"name":"released_at","type":"DATETIME","nullable":true,"primary_key":false}],"create_sql":"CREATE TABLE wp_bcog_usage_reservations ( id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, promotion_id BIGINT UNSIGNED NOT NULL, reservation_key CHAR(64) NOT NULL, scope VARCHAR(20) NOT NULL, subject_hash VARCHAR(64) NOT NULL, bucket_start DATETIME NOT NULL, status VARCHAR(20) NOT NULL, order_id BIGINT UNSIGNED NULL DEFAULT NULL, reserved_at DATETIME NOT NULL, expires_at DATETIME NOT NULL, confirmed_at DATETIME NULL DEFAULT NULL, released_at DATETIME NULL DEFAULT NULL, PRIMARY KEY (id), UNIQUE KEY bcog_reservation_key (reservation_key), KEY promo_scope_subject_bucket_status (promotion_id, scope, subject_hash, bucket_start, status), KEY status_expires (status, expires_at), KEY order_id (order_id) ) ENGINE"}],"table_count":6}