0

I am trying to fix this bug:

It looks like there is/are a deleted product(s):

Fatal error: Uncaught Error: Call to undefined method Magento\Catalog\Model\Product\Type\Virtual::getUsedProducts() in .../app/design/frontend/Mgs/claue_subchild/Magento_Catalog/templates/product/list.phtml:335 Stack trace: #0 .../vendor/magento/framework/View/TemplateEngine/Php.php(59): include() #1 .../vendor/magento/framework/View/Element/Template.php(271): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\ListProduct), '/home/ecommerc/...', Array) #2 .../vendor/magento/framework/View/Element/Template.php(301): Magento\Framework\View\Element\Template->fetchView('/home/ecommerc/...') #3 .../vendor/magento/framework/View/Element/AbstractBlock.php(1099): Magento\Framework\View\Element\Template->_toHtml() #4 .../vendor/magento/framework/View/Element/AbstractBlock.php(1103): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element{ in .../app/design/frontend/Mgs/claue_subchild/Magento_Catalog/templates/product/list.phtml on line 335

1
  • Please add fragment of code near line 335 (before and after) in app/design/frontend/Mgs/claue_subchild/Magento_Catalog/templates/product/list.phtml. This will help to answer to your question Jun 6, 2022 at 9:56

2 Answers 2

0

Check your app/design/frontend/Mgs/claue_subchild/Magento_Catalog/templates/product/list.phtml on line 335, try to comment it, then save. Then remove pub/static/frontend folder and run setup:static-content:deploy -f command. then check again.

Now if it works, then good, otherwise try to check the code in list.phtml file.

0

I found that one of my products is Virtual Product. I change the weight dropdown from "item has no weight" to "item has weight" and put something on the lbs textbox. The solution is to convert Virtual Product to Simple Product.

And the page displayed smoothly with that error.

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.