Am using v1.4.9.3 and I have the need to add 5 extra comment type fields to the order db. I modified the db structure for the order table and also modified the function create() in catalog/model/checkout/order.php. After completing guest checkout 2, I receive an error when I click on continue and confirm page appears. The error is "NOTICE: Undefined index: custom1 in catalog/model/checkout/order.php on line 70" and repeats for each of the 5 var's (custom1-5). The order will complete, but when I view the db, the data for my fields was not added. I have mimicked the comment field processing for my new fields in catalog/control, catalog/view and catalog/model (not line 70) and do not seem to encounter errors from those mods.
I am new to php, am humbled by the knowledge of the mod's and membersin this forum, and starting to wonder if this MVC architecture is beyond my abilities.
Can any one point me in the right direction on this problem, please? Seems like there is another function I have not mod'd.
MVC is nothing but organization. It doesn't really affect how the code works, just where it is separated and stored.
Model is where the db queries are stored
Controller is where the collecting and massaging for an individual page is stored
View is where the controller passes all of its variables for display
Starting with just 1 new field to keep it simple, the steps to add a new field are:
1. Add it to the db
Add the new field to your db table
2. Add the value to the $data array
The $data field you can see in the catalog/controller/checkout/confirm.php file is an array that is built and then passed into the create() function. So you will need to add:
$data['custom1'] = 'blahblah';
before the create() is called.
Now line 70 of the insert won't throw the error.
Model is where the db queries are stored
Controller is where the collecting and massaging for an individual page is stored
View is where the controller passes all of its variables for display
Starting with just 1 new field to keep it simple, the steps to add a new field are:
1. Add it to the db
Add the new field to your db table
2. Add the value to the $data array
The $data field you can see in the catalog/controller/checkout/confirm.php file is an array that is built and then passed into the create() function. So you will need to add:
$data['custom1'] = 'blahblah';
before the create() is called.
Now line 70 of the insert won't throw the error.
Who is online
Users browsing this forum: No registered users and 2 guests