backwoodswizards Merchant De United States Miembro desde abr. 2023 backwoodswizards 10 abr. 2025 04:24 Greetings Tim, Recently attempted to update to Affiliates v1.0.1 and get error: Fatal error: 1054 - Unknown column 'collect_parameters' in 'SET' update lcry_affiliates set status = 1, name = '*****', description = 'https://backwoodswizards.com/store/?affiliate_id=XXX', collect_parameters = '', webhook = '{\"method\":\"GET\",\"url\":\"\",\"data\":\"\"}', cookie_lifetime = '90', date_updated = '2025-04-09 22:23:08' where id = 2 limit 1; in ~/includes/library/lib_database.inc.php (Line 199) Warning: Undefined array key "cookie_lifetime" in ~/admin/affiliates.app/affiliates.inc.php (Line 72) Wondering if the README is missing some of the original and/or enhanced steps to create/update the column name in the table? All the Best, Rorik
tim Founder De Sweden Miembro desde may. 2013 tim 10 abr. 2025 04:52 What LiteCart version are you on? These should have been automated by the vmod for you. Upgrades also. I think this could be caused by the version numbering moving from dates to incremental numbers. Can you run the following query in phpmyadmin? ALTER TABLE `lcry_affiliates` ADD COLUMN `collect_parameters` VARCHAR(256) NOT NULL DEFAULT '' AFTER `description`, ADD COLUMN `webhook` TEXT NOT NULL DEFAULT '{}' AFTER `collect_parameters`, ADD COLUMN `cookie_lifetime` VARCHAR(64) NOT NULL DEFAULT '+30 days' AFTER `webhooks`;
backwoodswizards Merchant De United States Miembro desde abr. 2023 backwoodswizards 10 abr. 2025 17:47 We're running LiteCart v 2.6.2, softlicious usually updates within a few days of a new release. SQL command output MySQL returned an empty result set (i.e. zero rows). (Query took 0.0095 seconds.) ALTER TABLE `lcry_affiliates` ADD COLUMN `collect_parameters` VARCHAR(256) NOT NULL DEFAULT '' AFTER `description`, ADD COLUMN `webhooks` TEXT NOT NULL DEFAULT '{}' AFTER `collect_parameters`, ADD COLUMN `cookie_lifetime` VARCHAR(64) NOT NULL DEFAULT '+30 days' AFTER `webhooks`; Columns added (see attached). Error message after attempting to edit the Affiliate Cookie Lifetime was observed. Fatal error: 1054 - Unknown column 'webhook' in 'SET' update lcry_affiliates set status = 1, name = '*****', description = 'https://backwoodswizards.com/store/?affiliate_id=2', collect_parameters = '', webhook = '{\"method\":\"GET\",\"url\":\"\",\"data\":\"\"}', cookie_lifetime = '+90 days', date_updated = '2025-04-10 11:42:47' where id = 2 limit 1; in ~/includes/library/lib_database.inc.php (Line 199) Ran SQL MySQL returned an empty result set (i.e. zero rows). (Query took 0.0079 seconds.) ALTER TABLE `lcry_affiliates` ADD COLUMN `webhook` TEXT NOT NULL DEFAULT '{}' AFTER `collect_parameters`; So that looks all set, thanks Tim! Now I need to troubleshoot the customer vmod for "Repeat Customer" indicator for affiliate sales page :)
tim Founder De Sweden Miembro desde may. 2013 tim 10 abr. 2025 18:04 Man, so sorry. Indeed the word "webhooks" should be singular "webhook". You did the right thing👍
backwoodswizards Merchant De United States Miembro desde abr. 2023 backwoodswizards 11 abr. 2025 04:51 No worries, Tim, I enjoy learning new things! $affiliate_options = database::query( "select * from ". DB_TABLE_PREFIX ."affiliates order by name;" )->fetch(function($affiliate) { return [$affiliate['name'], $affiliate['id']]; }); This bit of code benefits greatly from fetch_all instead of fetch
tim Founder De Sweden Miembro desde may. 2013 tim 11 abr. 2025 14:04 Ooh thank you. Very good I will take it :)
tim Founder De Sweden Miembro desde may. 2013 tim 11 abr. 2025 20:51 While we are diving into this. Can you also change this line in vmod: $order->data['affiliate_id'] = (int)$_COOKIE['affiliate_id']; To $order->data['affiliate_id'] = (int)$affiliate_cookie['id'];
backwoodswizards Merchant De United States Miembro desde abr. 2023 backwoodswizards 12 abr. 2025 02:25 I have updated my vmod section for page pages/ajax/checkout_summary.inc.php to include the new code! Thanks Tim!