Originally Posted by
guido49
By the way, here's the SQL code as it's being run...maybe there's something wrong I just can't seem to see?
SET @gid=0;
SELECT @gid:=configuration_group_id
FROM zen_configuration_group
WHERE configuration_group_title LIKE '%USPS Auto-Fill Config%'
LIMIT 1;
DELETE FROM zen_configuration_group WHERE configuration_group_title LIKE '%USPS Auto-Fill Config%';
DELETE FROM zen_configuration_group WHERE configuration_group_title LIKE '%USPS AutoFill%';
DELETE FROM zen_configuration_group WHERE configuration_group_title LIKE '%USPS AutoFill Config%';
DELETE FROM zen_admin_pages WHERE page_key='uspsautofill';
DELETE FROM zen_configuration WHERE configuration_key LIKE 'USPS_RETURN%' LIMIT 8;
DELETE FROM zen_configuration WHERE configuration_key LIKE 'USPS_DELIVERY%' LIMIT 9;
# Insert New USPS AutoFill Configuration Group
INSERT INTO zen_configuration_group VALUES ('', 'USPS AutoFill', 'USPS AutoFill Config', '1', '1');
SET @gid=last_insert_id();
UPDATE zen_configuration_group SET sort_order = @gid WHERE configuration_group_id = @gid;
INSERT INTO zen_configuration VALUES (NULL, 'Return: Tracking Email', 'USPS_RETURN_TRACKING_EMAIL', '', 'Set this to the email address used for receiving tracking updates. ', @gid, '41', now(), now(), NULL, NULL), (NULL, 'Return: Tracking Notify via Email (checkbox)', 'USPS_RETURN_TRACKING_EMAIL_NOTIFY', 'false', 'Set this to true if you want to check the tracking notifications checkbox to receive tracking updates to the email specified.', @gid, '42', now(), now(), NULL, "cfg_select_option(array('true', 'false'),"), (NULL, 'Delivery: Default Notify via Email (checkbox)', 'USPS_DELIVERY_DEFAULT_EMAIL_NOTIFY', 'true', 'Set this to true if you want the Notify By Email checkbox checked by default', @gid, '45', now(), now(), NULL, "cfg_select_option(array('true', 'false'),"), NULL, 'Delivery: Default Contents Value', 'USPS_DELIVERY_DEFAULT_CONTENTS_VALUE', '', 'Set this to total or subtotal if you want to use that order value for the declaration value, or set this to a price if you want a default contents value for International shipping, or leave blank to not use it', @gid, '50', now(), now(), NULL, NULL), (NULL, 'Delivery: Default Weight (Pounds)',
'USPS_DELIVERY_DEFAULT_WEIGHTS_POUNDS', '', 'Set this to the default weight in pounds. Useful if you sell only one type of item. Leave blank if using the order total weight', @gid, '55', now(), now(), NULL, NULL), (NULL, 'Delivery: Default Weight (Ounces)', 'USPS_DELIVERY_DEFAULT_WEIGHTS_OUNCES', '', 'Set this to the default weight in ounces. Useful if you sell only one type of item. Leave blank if using the order total weight', @gid, '60', now(), now(), NULL, NULL), (NULL, 'Delivery: Default Shipping from Same ZipCode (Radio Button)', 'USPS_DELIVERY_SAME_ZIPCODE', 'same', 'Set this to same if you want to have your Return Address Zipcode as the default Ship-From zipcode. If set to Other, then enter in your default Ship-From zipcode in the next setting', @gid, '65', now(), now(), NULL, "cfg_select_option(array('same', 'other'),"), (NULL, 'Delivery: Default Shipping from Other ZipCode (If Radio Button set to Other)', 'USPS_DELIVERY_OTHER_ZIPCODE', '', 'Set the default ZipCode you would like as your Ship-From zipcode. Only if the above setting is set to Other', @gid, '70', now(), now(), NULL, NULL), (NULL, 'Delivery: Default Insurance Value', 'USPS_DELIVERY_INSURANCE_VALUE', '', 'Set to total or subtotal if you want to use that order value for the insurance value, or set to a price (i.e. 5.25) if you want to use a preset price. Or leave blank to not use it', @gid, '75', now(), now(), NULL, NULL);
ALTER TABLE zen_orders DROP total_weight;
ALTER TABLE zen_orders ADD total_weight FLOAT NOT NULL DEFAULT '-1';
# Register the pages for Admin Access Control
DELETE FROM zen_admin_pages WHERE page_key='uspsautofill';
INSERT INTO zen_admin_pages (page_key,language_key,main_page,page_params,menu_key,display_on_menu,sort_order ) VALUES
('uspsautofill','BOX_CONFIGURATION_USPS_AUTOFILL','FILENAME_CONFIGURATION','1',' configuration','Y','1');
UPDATE zen_admin_pages SET sort_order = (SELECT configuration_group_id FROM zen_configuration_group WHERE configuration_group_title = 'USPS AutoFill') WHERE page_key = 'uspsautofill';
UPDATE zen_admin_pages SET page_params = CONCAT('gID=',(SELECT configuration_group_id FROM zen_configuration_group WHERE configuration_group_title = 'USPS AutoFill')) WHERE page_key = 'uspsautofill';
Bookmarks