SET sql_mode = 'ALLOW_INVALID_DATES';

UPDATE `configuration` SET `configuration_value` = 'osConcert Version 10.3' WHERE `configuration`.`configuration_id` = 242;

INSERT INTO configuration
(configuration_title, configuration_key, configuration_value, configuration_description,
 configuration_group_id, sort_order, date_added, last_modified, use_function, set_function)
VALUES
('Enable Conversion Tracking', 'OSC_TRACKING_ENABLE', 'false',
 'Enable Google Ads / GA4 / Meta tracking on checkout success page',
 154, 900, NOW(), '0000-00-00 00:00:00', NULL,
 'tep_cfg_select_option(array(\"true\",\"false\"),'),

('Google Ads Conversion ID', 'OSC_GOOGLE_ADS_ID', '',
 'Example: AW-123456789',
 154, 901, NOW(), '0000-00-00 00:00:00', NULL, NULL),

('Google Ads Conversion Label', 'OSC_GOOGLE_ADS_LABEL', '',
 'Example: AbCdEfGhIjKlMnOpQr (from Google Ads conversion action)',
 154, 902, NOW(), '0000-00-00 00:00:00', NULL, NULL),

('GA4 Measurement ID', 'OSC_GA4_ID', '',
 'Example: G-ABC123DEF4',
 154, 903, NOW(), '0000-00-00 00:00:00', NULL, NULL),

('Meta Pixel ID', 'OSC_META_PIXEL_ID', '',
 'Example: 123456789012345',
 154, 904, NOW(), '0000-00-00 00:00:00', NULL, NULL),

('Google Tag Manager Container ID', 'OSC_GTM_ID', 'GTM-XXXXXXX',
 'Example: GTM-MPSCTSHJ',
 154, 905, NOW(), '0000-00-00 00:00:00', NULL, NULL);
 
 ALTER TABLE `categories_description` ADD `concert_address` VARCHAR(128) NOT NULL AFTER `section_id`; 
 
 INSERT INTO configuration
(configuration_title, configuration_key, configuration_value, configuration_description,
 configuration_group_id, sort_order, date_added, last_modified, use_function, set_function)
VALUES
('Enable Get Directions', 'GET_DIRECTIONS_ENABLE', 'false',
 'Enable Google Maps Get Directions at checkout success',
 154, 906, NOW(), '0000-00-00 00:00:00', NULL,
 'tep_cfg_select_option(array(\"true\",\"false\"),');
 
/* --- Social / OG meta settings (v2026) --- */

/* Optional: remove old keys first (keeps table clean) */
DELETE FROM configuration
WHERE configuration_key IN (
  'FB_APP_ID','FB_SITE_NAME','FB_URL','FB_TYPE','FB_TITLE','FB_DESCRIPTION','FB_IMAGE','FB_LOCALE',
  'FB_DATA_SIZE','FB_DATA_LAYOUT','FB_CONNECT',
  'OG_IMAGE_WIDTH','OG_IMAGE_HEIGHT','OG_IMAGE_TYPE',
  'TWITTER_CARD','TWITTER_SITE'
);

/* Insert fresh */
INSERT INTO configuration
(configuration_title, configuration_key, configuration_value, configuration_description,
 configuration_group_id, sort_order, date_added, last_modified, use_function, set_function)
VALUES
('Facebook App ID', 'FB_APP_ID', '', 'Optional. Create an app in Meta Developers if needed.', 154, 900, NOW(), NOW(), NULL, NULL),

('Open Graph Site Name', 'FB_SITE_NAME', 'osConcert', 'Displayed as site_name in social previews.', 154, 901, NOW(), NOW(), NULL, NULL),
('Open Graph Canonical URL', 'FB_URL', '', 'Full URL to the page that should be shared (recommended: your homepage).', 154, 902, NOW(), NOW(), NULL, NULL),
('Open Graph Type', 'FB_TYPE', 'website', 'Usually: website, article. (Event pages can override later.)', 154, 903, NOW(), NOW(), NULL, NULL),
('Open Graph Locale', 'FB_LOCALE', 'en_US', 'Locale like en_US, it_IT, de_DE.', 154, 904, NOW(), NOW(), NULL, NULL),

('Open Graph Title', 'FB_TITLE', '', 'Title used in link previews.', 154, 905, NOW(), NOW(), NULL, NULL),
('Open Graph Description', 'FB_DESCRIPTION', '', 'Description used in link previews.', 154, 906, NOW(), NOW(), NULL, NULL),
('Open Graph Image URL', 'FB_IMAGE', '', 'Full URL to preview image (recommended 1200x630).', 154, 907, NOW(), NOW(), NULL, NULL),

('OG Image Width', 'OG_IMAGE_WIDTH', '1200', 'Image width in pixels (recommended: 1200).', 154, 908, NOW(), NOW(), NULL, NULL),
('OG Image Height', 'OG_IMAGE_HEIGHT', '630', 'Image height in pixels (recommended: 630).', 154, 909, NOW(), NOW(), NULL, NULL),
('OG Image MIME Type', 'OG_IMAGE_TYPE', 'image/jpeg', 'Example: image/jpeg or image/png.', 154, 910, NOW(), NOW(), NULL, NULL),

('Twitter Card Type', 'TWITTER_CARD', 'summary_large_image', 'Usually summary_large_image.', 154, 911, NOW(), NOW(), NULL, NULL),
('Twitter @site', 'TWITTER_SITE', '', 'Optional. Example: @osconcert', 154, 912, NOW(), NOW(), NULL, NULL);

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES
('', 'Turnstile Site Key', 'TURNSTILE_SITE_KEY', '0', 'Turnstile CAPTCHA Site Key', 2, 11, '2026-01-01 00:00:00', '2026-01-01 00:00:00', NULL, NULL),
('', 'Turnstile Secret Key', 'TURNSTILE_SECRET_KEY', '0', 'Turnstile CAPTCHA Secret Key', 2, 12, '2026-01-01 00:00:00', '2026-01-01 00:00:00', NULL, NULL);

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES
('', 'Embed Video', 'EMBED_VIDEO', '', 'Paste Embed Video Slug or YT ID', 4, 18, '2020-01-01', '2020-01-01', NULL, 'tep_cfg_textarea('),
('', 'Hero Background', 'HERO_BG', '', 'Image Path for the Hero Background', 4, 18, '2020-01-01', '2020-01-01', NULL, NULL),
('', 'Footer Content Background', 'FOOTER_BG', '', 'Image Path for the Footer Background', 4, 18, '2020-01-01', '2020-01-01', NULL, NULL),
('', 'Hero Image', 'HERO_IMG', '', 'Image Path for the Hero Image', 4, 18, '2020-01-01', '2020-01-01', NULL, NULL),
('', 'Hero Background Overlay', 'HERO_BG_OVERLAY', '', ' Overlay Hero Background', 4, 18, '2020-01-01', '2020-01-01', NULL, NULL),
('', 'Footer Content Background Overlay', 'FOOTER_BG_OVERLAY', '', 'Image Path for the Footer Background', 4, 18, '2020-01-01', '2020-01-01', NULL, NULL),
('', 'Footer Overlay Accent', 'FOOTER_BG_OVERLAY_ACCENT', '', ' Overlay Accent Footer Background', 4, 18, '2020-01-01', '2020-01-01', NULL, NULL),
('', 'Hero Image Overlay Accent', 'HERO_BG_OVERLAY_ACCENT', '', ' Overlay Accent Hero Image', 4, 18, '2020-01-01', '2020-01-01', NULL, NULL);

UPDATE `customers_info_fields` SET `default_value` = 'math' WHERE `customers_info_fields`.`info_id` = 32;
ALTER TABLE `template` ADD `template_hero` VARCHAR(11) NOT NULL AFTER `header_height`;
ALTER TABLE `template` CHANGE `cart_in_header` `theme_mode` VARCHAR(6) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'yes';
ALTER TABLE `template` ADD `template_font` VARCHAR(128) NOT NULL AFTER `template_hero`;

INSERT INTO `template` (`template_id`, `template_name`, `date_added`, `last_modified`, `template_image`, `show_footer`, `include_column_left`, `include_column_right`, `howto`, `header_banner`, `show_breadcrumb`, `active`, `show_header_pane`, `languages_in_header`, `container_border`, `theme_mode`, `show_page_login`, `customer_greeting`, `show_topbar`, `template_color`, `header_height`, `template_hero`, `template_font`) VALUES
(7, 'webengine', '2026-04-28 00:00:00', '2026-04-29 00:00:00', '', 'yes', 'no', 'no', 'no', 'no', 'yes', '1', 'no', 'no', '', 'light', 'no', 'yes', 'no', 'blue-gold', 84, 'hero7', 'font7');

DELETE FROM `template` WHERE `template`.`template_id` = 1;
DELETE FROM `template` WHERE `template`.`template_id` = 4;
DELETE FROM `template` WHERE `template`.`template_id` = 5;
DELETE FROM `template` WHERE `template`.`template_id` = 6;

DELETE FROM `infobox_configuration` WHERE `template_id` !='7';

UPDATE `configuration` SET `configuration_value` = 'webengine' WHERE `configuration`.`configuration_id` = 10;
UPDATE `configuration` SET `configuration_value` = 'true' WHERE `configuration`.`configuration_id` = 262;

UPDATE `configuration` SET `set_function` = 'tep_cfg_textarea(' WHERE `configuration`.`configuration_id` = 307;


INSERT INTO `sql_queries` VALUES('osconcert_v9_1_3.sql', CURDATE());
INSERT INTO `sql_queries` VALUES('osconcert_v9_1_3.sql', CURDATE());