2

The time I am coming to onepage checkout, I am getting a critical error

CRIT (2): Not valid template file:frontend/base/default/template/aitcommonfiles/design--frontend--base--default--template--checkout--onepage--shipping_method.phtml

Because of this issue, customers are not being able to move to onepage checkout step 'shipping methods' from billing or shipping address.

Can anyone address the possible ways to handle this issue?

NOTE: I am using Magento v1.9.2.1.

1
  • Can you post your xml file as well. I think it is template path issue more than this one Commented Mar 31, 2016 at 10:21

2 Answers 2

6

A common cause of this error is the use of symlinks without enabling this in the admin area…

System > configuration > developer > Template Settings 

The error gets triggered in app\code\core\Mage\Core\Block\Template.php around line 243 ( see here ) - so if its not an issue with symlinks then this would be a good place to start debugging.

If you are not using xDebug then where the exception gets caught around line 250 you should either log or var_dump the values of:

$includeFilePath

and

$this->_viewDir

Then make sure they both exist (paying attention to the case)

Failing that you might want to look at permissions.

I suspect you have a third party module installed acting as a aitcommonfiles and as the error suggests the template file design--frontend--base--default--template--checkout--onepage--shipping_method.phtml does not exist in the location app/design/frontend/base/default/template/aitcommonfiles/.

This is a third party module I would re-install it, or find the missing template file and put it in the correct location, or contact the module provider for assistance.

12
  • If you notice then there is no - - in the file name Commented Mar 31, 2016 at 10:10
  • Man, do you mean the filename shipping_method.p‌​html ? Commented Mar 31, 2016 at 10:16
  • I like to mention that filename is shipping_method.p‌​html and not design--frontend--base--default--template--checkout--onepage--shipping_method.p‌​html at the location That means a directory separation, Isn't it? Commented Mar 31, 2016 at 10:23
  • Check updated answer Commented Mar 31, 2016 at 10:26
  • I am not having any aitcommonfiles module but I can see an empty directory named aitcommonfiles at design/frontend/base/default/template/ Also, the same code is running fine in live but setting up at staging having same environment is causing this error Commented Mar 31, 2016 at 10:32
2

After following many posts, this one played a trick:

https://stackoverflow.com/questions/12110389/magento-not-valid-template-file-page-1column-phtml/12115511#12115511

Approach I followed:

At line no. 250, I just logged $includeFilePath and $this->_viewDir for both the case, working live site and non-working staging site.

Observation:
working site logged: /var/ait_patch/design/frontend/base/default/template/aitcommonfiles/design--frontend--base--default--template--checkout--onepage--shipping_method.phtml

whereas non-working-site logged nothing inplace.
So, I looked into the directory if the file present or not and found that under the directory var/, this file was missing /var/ait_patch/design/frontend/base/default/template/aitcommonfiles/design--frontend--base--default--template--checkout--onepage--shipping_method.phtml
and adding that file by copying from a working site played the trick.

This was a headbaning as because it was hard to predict that any third party extension can place some files under var/ directory.

Thanks @Rohit got your effortless help!

1
  • Not valid template file:adminhtml/base/default/template/aitcommonfiles/design--adminhtml--default--default--template--sales--order--view--info.phtml I'm getting this exception in my log file. How u var_dump above 2 variables in template.php file Commented Mar 10, 2017 at 12:34

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.