mimicking MATC module.
Posted: Thu Dec 07, 2023 11:16 pm
Hello...
Because my store is a wholesale store only (ie no retail sales) I wanted to put an extra check box, like the MATC one that already exists on the customer account application form...
I copies the 3 MATC files (im modules/customer_data, Modules/customer_data/templates, and Languages)
and changed their name from matc to retail_agreement (eg cd_retail_agreement.php)
I then went through and change every instance of the variable matc to retail_agreement - the same way I would do if I copied any module...
I installed it and it ran fine the first time I tried to create a new customer... but as soon as I navigated away from it I got an error - in both the front of house and the admin side of the site...
Shop Error;
Admin Error;
Any idea how I can fix this? do I need to rip it all out and build the switch from scratch or is there an easier answer?
Because my store is a wholesale store only (ie no retail sales) I wanted to put an extra check box, like the MATC one that already exists on the customer account application form...
I copies the 3 MATC files (im modules/customer_data, Modules/customer_data/templates, and Languages)
and changed their name from matc to retail_agreement (eg cd_retail_agreement.php)
I then went through and change every instance of the variable matc to retail_agreement - the same way I would do if I copied any module...
I installed it and it ran fine the first time I tried to create a new customer... but as soon as I navigated away from it I got an error - in both the front of house and the admin side of the site...
Shop Error;
Code: Select all
PHP Fatal error: Uncaught Error: Class 'cd_retail_agreement' not found in .../includes/system/versioned/1.0.5.1/customer_data.php:27
Stack trace:
#0 /.../includes/classes/magic/loader.php(16): customer_data->__construct()
#1 /.../includes/system/versioned/1.0.8.1/hooks.php(160): Loader->__call('customer_data', Array)
#2 /.../includes/application_top.php(30): hooks->generate('startApplicatio...')
#3 /.../index.php(13): require('/home/devcreat/...')
#4 {main}
thrown in /.../includes/system/versioned/1.0.5.1/customer_data.php on line 27
Code: Select all
PHP Fatal error: Uncaught Error: Class 'cd_retail_agreement' not found in /.../includes/system/versioned/1.0.5.1/customer_data.php:27
Stack trace:
#0 /.../admin/includes/application_top.php(152): customer_data->__construct()
#1 /.../admin/customers.php(14): require('/home/devcreat/...')
#2 {main}
thrown in /.../includes/system/versioned/1.0.5.1/customer_data.php on line 27