Forums / All Other Contributions/Addons / Help uninstalling How Did You Hear About Us addon

Help uninstalling How Did You Hear About Us addon

Views: 883

Results 1 to 3 of 3
20 Aug 2011, 2:42 AM
#1
cybagirl avatar

cybagirl

Zen Follower

Join Date:
Jul 2009
Posts:
119
Plugin Contributions:
0

Help uninstalling How Did You Hear About Us addon

Hello I was wondering if someone can please tell me the exact code I would need to enter and run in the Install SQL Patches in the ZenCart Admin Panel to uninstall the following code from the database?

As the following code was entered and ran in the Install SQL Patches in the ZenCart Admin Panel for the mod to work. But now I would like to remove all traces of it from the Database.

DROP TABLE IF EXISTS sources;
CREATE TABLE sources (
  sources_id int NOT NULL auto_increment,
  sources_name varchar(64) NOT NULL,
  PRIMARY KEY (sources_id),
  KEY IDX_SOURCES_NAME (sources_name)
);

INSERT INTO sources VALUES (1, 'Google');
INSERT INTO sources VALUES (2, 'Yahoo!');
INSERT INTO sources VALUES (3, 'AOL');
INSERT INTO sources VALUES (4, 'MSN');
INSERT INTO sources VALUES (5, 'ZenCart');

DROP TABLE IF EXISTS sources_other;
CREATE TABLE sources_other (
  customers_id int NOT NULL default '0',
  sources_other_name varchar(64) NOT NULL,
  PRIMARY KEY (customers_id)
);

ALTER TABLE customers_info ADD customers_info_source_id int NOT NULL AFTER customers_info_date_account_last_modified;


INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display "Other" Referral option', 'DISPLAY_REFERRAL_OTHER', 'true', 'Display "Other - please specify" with text box in referral source in account creation', '1', '22', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Require Referral', 'REFERRAL_REQUIRED', 'true', 'Require the Referral Source in account creation', '5', '6', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now());

This question was asked in the mods thread a couple of times but no one replied. So I thought it best to ask this question in this section as a general question in the hope that someone will know how to do this and be kind enough to reply on how it can be done properly.

If someone can please help me with this that would be great and I will let the others know how it can be done as well.

Thanks.

21 Aug 2011, 10:14 AM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Help uninstalling How Did You Hear About Us addon

CybaGirl:

Hello I was wondering if someone can please tell me the exact code I would need to enter and run in the Install SQL Patches in the ZenCart Admin Panel to uninstall the following code from the database?

WARNING: The code below is untested. Use at your own risk.

GENERAL INFO: As a rule there is rarely ever a need to 'undo' changes made to the database when removing modules. Doing so will often cause more problems that its worth.

If this module has changed any files by including references to these database fields, and you remove the fields, the store will crash. On the other hand, these fields will happily exist without causing any harm or problems if nothing else exists that refer to them.

Anyway, if you feel you must, then the following code should work.

DROP TABLE IF EXISTS sources;
DROP TABLE IF EXISTS sources_other;
ALTER TABLE customers_info DROP COLUMN customers_info_source_id
DELETE from configuration where configuration_key = 'DISPLAY_REFERRAL_OTHER'
DELETE from configuration where configuration_key = 'REFERRAL_REQUIRED'
```Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

23 Aug 2011, 10:44 PM
#3
cybagirl avatar

cybagirl

Zen Follower

Join Date:
Jul 2009
Posts:
119
Plugin Contributions:
0

Re: Help uninstalling How Did You Hear About Us addon

Hello Rod hope all is well and thank you so very much for your reply.

I should have known that you would know how to do this :smile: .

Thanks again!

:clap: