Fatal error: Call to a member function f() on a non-object

Before you ask about IDnR Addon see the VirtueMart - Invoice, Delivery Note and Receipt Addon
bcoelho
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 12 Jun 2011, 17:54

Fatal error: Call to a member function f() on a non-object

Post by bcoelho »

I am using Joomla 1.5.23, VM 1.1.8 and the latest release of VM IDnR.

I am trying to insert sales tax info from the Purchase Order confirmation email into my PDF Invoice.

I have followed the directions from this post: viewtopic.php?f=27&t=5454

I inserted this function (from ps_checkout.php) into virtuemartpdfoutput.php:

function show_tax_details( $details, $currency = '' ) {
global $discount_factor, $CURRENCY_DISPLAY, $VM_LANG;

if( !isset( $discount_factor) || !empty($_REQUEST['discount_factor'])) {
$discount_factor = 1;
}
$auth = $_SESSION['auth'];
if( !is_array( $details )) {
$details = @unserialize( $details );
if( !is_array($details)) {
return false;
}
}
$html_rate = '';
$html = '';
if( sizeof( $details) > 1 ) {
foreach ($details as $rate => $value ) {
if( !$auth['show_price_including_tax']) {
$value /= $discount_factor;
}
if ( !empty($value) ){
$rate = str_replace( '-', $CURRENCY_DISPLAY->decimal, $rate )*100;
$html_rate .= $CURRENCY_DISPLAY->getFullValue( $value, 5, $currency ).' ('.$rate.'% '.$VM_LANG->_('PHPSHOP_CART_TAX').')<br />';
}
}
if ( !empty( $html_rate )){
$html = '<br />'.$VM_LANG->_('VM_TAXDETAILS_LABEL').':<br />'.$html_rate ;
}
}
return $html;
}

I then called the function in tmpl.invoice.php and when I click on the PDF Invoice I get an error message in tmpl.invoice.php on the row where I entered this code:
<td align="right">'.show_tax_details($db->f('order_tax_details'), $db->f('order_currency')).'</td>

The error message is:
"Fatal error: Call to a member function f() on a non-object"

Any idea on what is casing this?
bcoelho
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 12 Jun 2011, 17:54

Re: Fatal error: Call to a member function f() on a non-obje

Post by bcoelho »

Please follow this thread here: viewtopic.php?f=27&t=16019
Post Reply