mimicking MATC module.

Open to all! Ask other shopowners for help.
Post Reply
User avatar
Portman
Contributor
Posts: 158
Joined: Mon Mar 08, 2021 1:04 am
Phoenix Version: v1.0.8.20
Has thanked: 29 times
Been thanked: 4 times

mimicking MATC module.

Post by Portman »

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;

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
Admin 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 /.../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
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?


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
Portman
Contributor
Posts: 158
Joined: Mon Mar 08, 2021 1:04 am
Phoenix Version: v1.0.8.20
Has thanked: 29 times
Been thanked: 4 times

Re: mimicking MATC module.

Post by Portman »

Deleted module and mimicked newsletter module instead - made it a required field and it did the job for me


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply