-1

I tried to access customer section of opencart in the admin panel and got this message

Parse error: syntax error, unexpected '&&' (T_BOOLEAN_AND), expecting ')' in /var/www/vhosts/cloud9herbals.com/cloud9hemp/dev/admin/controller/customer/customer.php on line 1105

This is the code on line 1105

} elseif (($custom_field['type'] == 'text' && !empty($custom_field['validation'] && $custom_field['location'] == 'address')) && !filter_var($value['custom_field'][$custom_field['custom_field_id']], FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $custom_field['validation'])))) {

If that isn't enough here is the entire statemnt

foreach ($custom_fields as $custom_field) {
                if (($custom_field['location'] == 'address') && $custom_field['required'] && empty($value['custom_field'][$custom_field['custom_field_id']])) {
                    $this->error['address'][$key]['custom_field'][$custom_field['custom_field_id']] = sprintf($this->language->get('error_custom_field'), $custom_field['name']);
                } elseif (($custom_field['type'] == 'text' && !empty($custom_field['validation'] && $custom_field['location'] == 'address')) && !filter_var($value['custom_field'][$custom_field['custom_field_id']], FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $custom_field['validation'])))) {
                    $this->error['address'][$key]['custom_field'][$custom_field['custom_field_id']] = sprintf($this->language->get('error_custom_field_validate'), $custom_field['name']);
                }
            }

I know very little about php but would really like to fix this issue

chris85
  • 23,846
  • 7
  • 34
  • 51
DMConklin
  • 21
  • 6

1 Answers1

0

this

empty($custom_field['validation'] && $custom_field['location'] == 'address'))

needs to be

empty($custom_field['validation']) && $custom_field['location'] == 'address')
Sam Orozco
  • 1,258
  • 1
  • 13
  • 27