1

I am trying to work out why related products arent being displayed on my frontend, and when I check the logs I am presented with the below. Any help would be great. Thanks

[2019-02-14 13:56:02] main.CRITICAL: Invalid template file: 'public_html/var/view_preprocessed/pub/static/app/design/frontend/GladiatorFitness/Gladiator/Magento_Catalog/templates/product/list/items.phtml' in module: 'Magento_Catalog' block's name: 'catalog.product.related' [] []
[2019-02-14 13:56:02] main.CRITICAL: Invalid template file: 'public_html/var/view_preprocessed/pub/static/app/design/frontend/GladiatorFitness/Gladiator/Magento_Catalog/templates/product/list/items.phtml' in module: 'Magento_Catalog' block's name: 'product.info.upsell' [] []
1

It seems some minor oversight. To resolve this issue make sure the following things.

Check the path of your template file and make sure everything is right. In your case, is your theme name begins with Capital letter or its just gladiator ?

app/design/frontend/GladiatorFitness/Gladiator/Magento_Catalog/templates/product/list/items.phtml

As an alternate, you can also override this template in a custom module as explained in this answer

To know exactly what might be the issue, you need to debug these files and methods

magento2\vendor\magento\framework\View\Element\Template.php::fetchView magento2\vendor\magento\framework\View\Element\Template\File\Validator.php::isValid

These will help you to solve your issue.

  • that link is exactly what we have done, I have redeployed static content and it seems to have addressed the issue – Paul 'Whippet' McGuane Feb 16 at 10:49
  • cool, glad that you are able to sort this out in no time. May be you can also update your question, with exactly what you did to solve this issue, which can help others and of course get you some points. – Haijerome Feb 16 at 10:51

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.