VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: corymp on April 12, 2012, 20:37:59 PM

Title: [SOLVED] Warning and Fatal error on checkout
Post by: corymp on April 12, 2012, 20:37:59 PM
Getting this on checkout.....

Warning: require(__DIR__/invoice_items.php) [function.require]: failed to open stream: No such file or directory in /xxxxxxxx/components/com_virtuemart/views/invoice/tmpl/mail_html_pricelist.php on line 22

Fatal error: require() [function.require]: Failed opening required '__DIR__/invoice_items.php' (include_path='.:/usr/lib/php5') in /xxxxxxx/components/com_virtuemart/views/invoice/tmpl/mail_html_pricelist.php on line 22

[attachment cleanup by admin]
Title: Re: Warning and Fatal error on checkout
Post by: andreasgr on April 12, 2012, 22:27:11 PM
hi

i have the same problem

joomla 2.5.4
vm 2.0.4 stable
2 languages installed (english, greek)
Title: Re: Warning and Fatal error on checkout
Post by: corymp on April 13, 2012, 00:10:20 AM
Anyone else?

This seems to only have happened since 2.0.4 Stable
Title: Re: Warning and Fatal error on checkout
Post by: corymp on April 13, 2012, 00:20:55 AM
I've fixed it.

on line 22 of:
/components/com_virtuemart/views/invoice/tmpl/mail_html_pricelist.php

replace:
require(__DIR__.'/invoice_items.php');

with:
require('invoice_items.php');

not sure if this is messing with anything else, but this rids the error and everything works now including emails
Title: Re: [SOLVED] Warning and Fatal error on checkout
Post by: brentonking on April 14, 2012, 05:08:32 AM
Just an additional note:
If you are running template override files (which you should be!) in "/templates/YOUR-TEMPLATE/html/com_virtuemart", you will also need to make sure you have "invoice_items.php" in the too.
If you don't you will still get the same error.

So if you are using the template overrides make sure you copy and add:
/templates/YOUR-TEMPLATE/html/com_virtuemart/invoice/invoice_items.php
& also copy and edit:
/templates/YOUR-TEMPLATE/html/com_virtuemart/invoice/mail_html_pricelist.php (along with the fix corymp mentioned)





Title: Re: [SOLVED] Warning and Fatal error on checkout
Post by: corymp on April 14, 2012, 06:18:50 AM
I left out the part about the overrides because we shouldn't be expected to override something that needs to be fixed in the core. I'm afraid to mention that it's a bug because most of the time it's not a bug. I don't like people starting posts about bugs when chances are; the user is doing something wrong..
Title: Re: [SOLVED] Warning and Fatal error on checkout
Post by: Milbo on April 15, 2012, 14:11:56 PM
The answer is that __DIR__ exists only in php5.3 and higher. A workaround is provided
Title: Re: [SOLVED] Warning and Fatal error on checkout
Post by: corymp on April 15, 2012, 14:17:45 PM
lol
Quote from: Milbo on April 15, 2012, 14:11:56 PM
The answer is that __DIR__ exists only in php5.3 and higher. A workaround is provided

Where is the workaround provided?