News:

Support the VirtueMart project and become a member

Main Menu

[SOLVED] Warning and Fatal error on checkout

Started by corymp, April 12, 2012, 20:37:59 PM

Previous topic - Next topic

corymp

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]
VM 2.0.4 Stable
J2.5.4

andreasgr

hi

i have the same problem

joomla 2.5.4
vm 2.0.4 stable
2 languages installed (english, greek)

corymp

Anyone else?

This seems to only have happened since 2.0.4 Stable
VM 2.0.4 Stable
J2.5.4

corymp

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
VM 2.0.4 Stable
J2.5.4

brentonking

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)






corymp

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..
VM 2.0.4 Stable
J2.5.4

Milbo

The answer is that __DIR__ exists only in php5.3 and higher. A workaround is provided
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

corymp

#7
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?
VM 2.0.4 Stable
J2.5.4