0

I am using Magento 2.3 CE on ubuntu 18 with SM Moonlight theme, the issue is when I search any product it shows suggested products but without loading CSS and template. Here is the image for view https://imgur.com/a/kIlDbfM It also shows 500 (Internal Server Error) on the search result page.

  • remove var/cache and var/view_preprocessed and run all command and check – Mohit Patel May 15 at 12:52
  • removed these folders and run commands still same issue – ishaq May 20 at 19:46
  • search but click after css or js are load ??? check your console – Mohit Patel May 20 at 19:48
  • If products are found during it shows internal server error 500 in the browser console, and if the product is not found it show no error – ishaq May 21 at 7:01
0

Check if there's a permission issue with var and pub/static folder. Please give full permission to your var and pub/static folder.

Once permission applied to a directory, run below commands:

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento cache:flush

At last, remove your browser cache and check again.

Hope this helps!

| improve this answer | |
  • Applied all steps, Still same issue search result with no css and js applied – ishaq May 20 at 19:46
  • Enable the error reporting and check if there's any error reported or logged. – Bhaumik Upadhyay May 21 at 1:29
  • If products are found during it shows internal server error 500 in the browser console, and if the product is not found it show no error – ishaq May 21 at 7:00
  • Getting below error in error.log file, I have noticed not all products search throwing error, some products search are working without any error. PHP Fatal error: Uncaught Error: Call to a member function getId() on null in /var/www/html/app/design/fronend/Eotrace/base/Magento_Catalog/templates/product/price/final_price.phtml:11\nStack trace:\n#0 /var/www/html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include()\n#1 /var//www/html/vendor/magento/framework/View/Element/Template.php(271): – ishaq May 21 at 8:25
  • Try if (!$product->getId()) to if (!$product) in code if if helps! – Bhaumik Upadhyay May 21 at 9:29
0

This code solved my issue.

<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product_id = $this->getRequest()->getParam('id');
$productData = $objectManager->get('Magento\Catalog\Model\Product')->load($product_id); $rfqonlyProduct = $productData['rfq_only']; ?>

This line of code was throwing error before.

$product_id = $currentProduct->getId();

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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