I have already traced down the files that need to be edited however for some reason custom fields are stored as an array in open cart. I have no problem editing the source codes from the php's and tpl's with standard fields but whenever I try to call an array it doesn't work. According to all the code I have analyzed nothing in Open Cart calls an array field anywhere so not sure of the coding to be honest. Not sure exactly what I am doing wrong. Been messing with it for almost 12 hours to no avail. I am either missing something or doing something wrong but I cant figure it out. One of my problems mainly seems to stem from the language file. When ever I add an entry or make any modifications to the language file it just crashes which is extremely odd for some reason. But I need to edit the language file for it to pull the text values for all appropriate pages. At this point I am just stuck. So thought I would seek some help here.
Here is a few sections of code that would need to be modified.
from opencart\admin\view\template\customer\customer_list.tpl
Code: Select all
<div class="form-group">
<label class="control-label" for="input-name"><?php echo $entry_name; ?></label>
<input type="text" name="filter_name" value="<?php echo $filter_name; ?>" placeholder="<?php echo $entry_name; ?>" id="input-name" class="form-control" />
</div>
When ever I edit the language file to include an entry_custom_company = 'Company Name' the system crashes. I could hard code this part I guess. How ever trying to edit the rest with filter_(name of field) nothing works since it is a stupid array. It doesn't crash just doesn't work.
from opencart\admin\controller\customer\customer.php
Code: Select all
if (isset($this->request->get['filter_name'])) {
$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
}
Same here trying to edit the filter_(field Name) to call an array fails. It doesn't crash just doesn't work.
Seems like the only time the site will crash is when the language file is modified.
Looking at the way it displays in the web source however is even more confusing.
from source code from customers showing data field.
Code: Select all
<div class="form-group custom-field custom-field1" data-sort="0">
<label class="col-sm-2 control-label" for="input-custom-field1">Company Name</label>
<div class="col-sm-10">
<input type="text" name="custom_field[1]" value="tts" placeholder="Company Name" id="input-custom-field1" class="form-control" />
</div>
</div>
looking at the name and input it seems to call an array to display the data. Which is interesting and confusing.
Attached is a few screen shots of what I am trying to accomplish as well as a screenshot from phpMyAdmin showing how the value is stored.
Thank you.