Post by sidclel » Sat Aug 09, 2025 11:02 pm

how to fix this error in google base opencart 3.0.4.1
Unknown: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in /home1/dddd/public_html/br/catalog/controller/extension/feed/google_base.php on line
see url below
https://www.saleples.com/br/index.php?r ... oogle_base

https://www.saleples.com/


New member

Posts

Joined
Sat Apr 14, 2012 9:19 am


Post by JNeuhoff » Sun Aug 10, 2025 12:54 am

Replace line 39 in file catalog/controller/extension/feed/google_base.php with this one:

Code: Select all

						$output .= '<g:brand><![CDATA[' . html_entity_decode((string)$product['manufacturer'], ENT_QUOTES, 'UTF-8') . ']]></g:brand>';
It's already fixed in the upcoming OpenCart 3.0.5.0.

The error is caused by missing manufacturers in your products.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by khnaz35 » Sun Aug 10, 2025 1:01 am

sidclel wrote:
Sat Aug 09, 2025 11:02 pm
/home1/dddd/public_html/br/catalog/controller/extension/feed/google_base.php on line
Online 39 you have like this

Code: Select all

$output .= '<g:brand><![CDATA[' . html_entity_decode($product['manufacturer'], ENT_QUOTES, 'UTF-8') . ']]></g:brand>';
replace it with

Code: Select all

$output .= '<g:brand><![CDATA[' . html_entity_decode($product['manufacturer'] ?? '', ENT_QUOTES, 'UTF-8') . ']]></g:brand>';
This error happens because in PHP 8.1+, calling html_entity_decode() with null instead of a string is deprecated — the $string argument must now always be a string.

Got a burning question at 3 AM that even Google shrugs at? There’s a not-so-secret inbox that might just have your answer: khnaz35@gmail.com
Breathe in some nature while you're at it. It’s cheaper than therapy. :-*

Feel free to sling a bear my way via PayPal @ khnaz35@gmail.com


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by sidclel » Sun Aug 10, 2025 1:06 am

Another mistake is if you delete the dollar currency it gets full of errors
https://www.saleples.com/br/index.php?r ... oogle_base

https://www.saleples.com/


New member

Posts

Joined
Sat Apr 14, 2012 9:19 am


Post by khnaz35 » Sun Aug 10, 2025 2:53 pm

That's not a mistake this is how opencart works default is set to USD, you can keep it

Got a burning question at 3 AM that even Google shrugs at? There’s a not-so-secret inbox that might just have your answer: khnaz35@gmail.com
Breathe in some nature while you're at it. It’s cheaper than therapy. :-*

Feel free to sling a bear my way via PayPal @ khnaz35@gmail.com


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by by mona » Mon Aug 11, 2025 9:59 pm

sidclel wrote:
Sun Aug 10, 2025 1:06 am
Another mistake is if you delete the dollar currency it gets full of errors
https://www.saleples.com/br/index.php?r ... oogle_base
1. You should not have error logging on a live site - it is a security risk.
2. It is only a warning - it is due to php 8 upgrades.
3. The error is because USD is not defined. If you have deleted it - it is not defined.

Search google for
a. php8 Undefined array key
b. php8 Trying to access array offset on value of type null

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am
Who is online

Users browsing this forum: No registered users and 19 guests