Parse Error Syntax Error Unexpected T_boolean_and
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might opencart parse error: syntax error, unexpected '&&' (t_boolean_and), expecting ')' have Meta Discuss the workings and policies of this site About parse error: syntax error, unexpected t_boolean_and, expecting ')' opencart Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting admin/controller/customer/customer.php on line 1105 ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million
Syntax Error Unexpected && T_boolean_and Expecting Opencart
programmers, just like you, helping each other. Join them; it only takes a minute: Sign up unexpected T_BOOLEAN_AND error in my if statement up vote 1 down vote favorite I have the following IF statement: if (strpos($_SERVER['REQUEST_URI'], '/dev/mahjong/mahjong.php') === strlen($_SERVER['REQUEST_URI']) - strlen('/dev/mahjong/mahjong.php') ) { $style = "display: inline"; } else { $style = "display: none"; opencart download } This works great. Now I wanted to show a Facebook login screen when $style = "display:inline"; So I figured, I make another IF with an AND, so IF display = inline AND user is NOT logged in, set $fb_login = "display: inline"; I've cooked up this code: if (strpos($_SERVER['REQUEST_URI'], '/dev/mahjong/mahjong.php') === strlen($_SERVER['REQUEST_URI']) - strlen('/dev/mahjong/mahjong.php') ) { $style = "display: inline"; } else { $style = "display: none"; } if ($style = "display: inline") && (!$user)) { $fb_login = "display: inline"; } else { $fb_login = "display: none"; } Problem is I get an error with this: Parse error: syntax error, unexpected T_BOOLEAN_AND Also tried to use AND instead of && but it gave the same result. What am I doing wrong here? php facebook if-statement share|improve this question asked Dec 29 '11 at 13:29 Maurice 576730 add a comment| 3 Answers 3 active oldest votes up vote 3 down vote accepted Your assignment operator (=) should be a comparison operator (==) The
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 http://stackoverflow.com/questions/8668461/unexpected-t-boolean-and-error-in-my-if-statement million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up syntax error, unexpected '&&' (T_BOOLEAN_AND), expecting ')' in opencart when clicking on customer up vote 0 down vote favorite No idea what it means as am not a developer. I do have access to a HTML editor http://stackoverflow.com/questions/35939201/syntax-error-unexpected-t-boolean-and-expecting-in-opencart-when-cl/35980302 (DW) so could change if told what to do. I get this error when I click on customer in my admin Opencart. Parse error: syntax error, unexpected '&&' (T_BOOLEAN_AND), expecting ')' in /var/sites/p/proteinporridgewales.co.uk/public_html/cart/admin/controller/customer/customer.php on line 1105 Thanks in advance opencart2.x share|improve this question edited Mar 11 at 12:10 Wolf 3,36421545 asked Mar 11 at 11:32 Matthew Anderson 111 1 paste line 1105 please :) –Ali Zia Mar 11 at 11:33 add a comment| 3 Answers 3 active oldest votes up vote 3 down vote Its a mistake in opencart 2.2.0.0. THey have updated their master repository. You can also do this directly. Here is the solved line 1105 of admin/controller/customer/customer.php Replace with this line } elseif (($custom_field['type'] == 'text' && !empty($custom_field['validation']) && $custom_field['location'] == 'address') && !filter_var($this->request->post['custom_field'][$custom_field['custom_field_id']], FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => $custom_field['validation'])))) { You can visit this for more details. share|improve this answer answered Mar 14 at 5:45 Vidhyut Pandya 1,0381315 add a comment| up vote 0 down vote I
Sign in Pricing Blog Support Search https://github.com/opencart/opencart/issues/4106 GitHub This repository Watch 567 Star 2,906 Fork 2,557 opencart/opencart Code Issues 67 Pull requests 41 Projects 0 Wiki Pulse Graphs New issue admin/controller/customer/customer.php fix #4106 Closed bluegeeks opened this Issue Mar 13, 2016 · 4 comments Projects None yet syntax error Labels None yet Milestone No milestone Assignees No one assigned 4 participants bluegeeks commented Mar 13, 2016 Hey, I found a bug that gave this error: Parse error: syntax error, unexpected '&&' (T_BOOLEAN_AND), expecting ')' in /home/bluegeek/public_html/clients/computers/admin/controller/customer/customer.php on line syntax error unexpected 1105 I managed to fix it so please update this is your new release :) Edit the file: admin/controller/customer/customer.php find: 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']);
} and replace with: 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']);
} you can compare both and see that there was a missing ) on $cu