Hi all
Happy Monday!
Using open cart 3.0.3.3 on php7.4 using basel theme.
Today I signed up as a customer on a testing/demo account and noticed this message:
Any ideas?
thanks a lot!
Notice: Trying to access array offset on value of type bool in /home/public_html/storage/modification/catalog/controller/startup/startup.php on line 187Notice: Trying to access array offset on value of type bool in /home/public_html/storage/modification/catalog/controller/startup/startup.php on line 187
Happy Monday!
Using open cart 3.0.3.3 on php7.4 using basel theme.
Today I signed up as a customer on a testing/demo account and noticed this message:
Any ideas?
thanks a lot!
Notice: Trying to access array offset on value of type bool in /home/public_html/storage/modification/catalog/controller/startup/startup.php on line 187Notice: Trying to access array offset on value of type bool in /home/public_html/storage/modification/catalog/controller/startup/startup.php on line 187
This is the part:
// Tax
$this->registry->set('tax', new Cart\Tax($this->registry));
if (isset($this->session->data['shipping_address'])) {
$this->tax->setShippingAddress($this->session->data['shipping_address']['country_id'], $this->session->data['shipping_address']['zone_id']);
} elseif ($this->config->get('config_tax_default') == 'shipping') {
$this->tax->setShippingAddress($this->config->get('config_country_id'), $this->config->get('config_zone_id'));
}
Line 187 is: $this->tax->setShippingAddress($this->session->data['shipping_address']['country_id'], $this->session->data['shipping_address']['zone_id']);
// Tax
$this->registry->set('tax', new Cart\Tax($this->registry));
if (isset($this->session->data['shipping_address'])) {
$this->tax->setShippingAddress($this->session->data['shipping_address']['country_id'], $this->session->data['shipping_address']['zone_id']);
} elseif ($this->config->get('config_tax_default') == 'shipping') {
$this->tax->setShippingAddress($this->config->get('config_country_id'), $this->config->get('config_zone_id'));
}
Line 187 is: $this->tax->setShippingAddress($this->session->data['shipping_address']['country_id'], $this->session->data['shipping_address']['zone_id']);
Probably, "shipping_addess" session array is not present.
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
Thanks a lot ADD Creative!
Sorry not expert.... should I just rename the file startup.php to application.php and replace the complete code (or add the new code lines(green))?
Will that change affect the rest of the open cart code?
I have open cart 3.0.3.3
thanks!
Sorry not expert.... should I just rename the file startup.php to application.php and replace the complete code (or add the new code lines(green))?
Will that change affect the rest of the open cart code?
I have open cart 3.0.3.3
thanks!
I would just remove the red lines and add the green for now. Remember to take a backup first.
If your site is a live site you need to switch off displaying of errors. Then look in you logs for errors.
You need make sure display errors in set to off in all 3 places. Your PHP settings, in system/config/default.php and in the settings. Not only can this cause minor notices and warnings to cause bigger errors, as you have seen, it can also be a security risk.
1. In your PHP settings make sure display_errors is set to Off. Use phpinfo() to check. It should be off by default, but there are lots of rubbish hosts out there.
2. In system/config/default.php set error_display to false.
3. In your OpenCart Setting on the server tab set Display Errors to No.
If your site is a live site you need to switch off displaying of errors. Then look in you logs for errors.
You need make sure display errors in set to off in all 3 places. Your PHP settings, in system/config/default.php and in the settings. Not only can this cause minor notices and warnings to cause bigger errors, as you have seen, it can also be a security risk.
1. In your PHP settings make sure display_errors is set to Off. Use phpinfo() to check. It should be off by default, but there are lots of rubbish hosts out there.
2. In system/config/default.php set error_display to false.
3. In your OpenCart Setting on the server tab set Display Errors to No.
Appreciate a lot you taking the time to give such a detailed explanation. Thanks!
After removing the red code and adding the green code, should I should I rename the file startup.php to application.php and uploaded it back to:
/home/public_html/storage/modification/catalog/controller/startup/ ?
After removing the red code and adding the green code, should I should I rename the file startup.php to application.php and uploaded it back to:
/home/public_html/storage/modification/catalog/controller/startup/ ?
There is no need to change the name of the file. I'm not sure where you have that name from.
1. Backup your site and database.
2. Download your catalog/controller/startup/startup.php file from your server or edit on the server.
3. Change.
To.
And.
To.
4. Upload your changed catalog/controller/startup/startup.php to the server or save if editing on the server.
5. Refresh your modifications.
1. Backup your site and database.
2. Download your catalog/controller/startup/startup.php file from your server or edit on the server.
3. Change.
Code: Select all
if (isset($this->session->data['shipping_address'])) {
Code: Select all
if (isset($this->session->data['shipping_address']['country_id']) && isset($this->session->data['shipping_address']['zone_id'])) {
Code: Select all
if (isset($this->session->data['payment_address'])) {
Code: Select all
if (isset($this->session->data['payment_address']['country_id']) && isset($this->session->data['payment_address']['zone_id'])) {
5. Refresh your modifications.
Thanks for the clear explanation!
I came with the file name change form here:
https://i.imgur.com/tBtrw9L.png
Not expert so guess that doesn't mean a file name change
I came with the file name change form here:
https://i.imgur.com/tBtrw9L.png
Not expert so guess that doesn't mean a file name change
It does mean a name change, but it not the change I linked to, which does not include a name change.
Who is online
Users browsing this forum: No registered users and 16 guests