I have installed porto theme on Magento 2.3.5p1 version.

After installing theme it shows error like:

ReferenceError: mageplazaSearchProducts is not defined

I have checked that one file default_0.js created in


but found that there is missing values for mageplazaSearchProducts.

var mageplazaSearchProducts = 

can anyone suggest me how to solve this error ??

2 Answers 2


Check data in $productList variable in app/code/Mageplaza/Search/Helper/Data.php. In my case, was the product description that was causing a encoding problem when trying to encode as json. Ended up wrapping the description in the htmlentities function

  • Thanks for answering. but its not working for me.
    – vijay rami
    Commented Jul 28, 2020 at 7:21
  • i have same issue facing any idea for that? Commented Oct 4, 2020 at 6:56

Thanks to @Gianr's answer I managed to fix this by doing the following:

Place the htmlentities tag around the product description $this->getProductDescription($product, $store) in file app/code/Mageplaza/Search/Helper/Data.php somewhere around line #230.

Then rename the file pub/media/mageplaza/search/default_0.js to xdefault_0.js. Clear the cache and reload the page. A new default_0.js file should be generated WITH content. Problem solved!

Upvote if this fixed your problem plz!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.