VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Payment VM 1.1 => PayPal / PayPal Pro VM 1.1 => Topic started by: dan1234 on September 01, 2008, 05:59:35 AM

Title: Annoying error above paypal button
Post by: dan1234 on September 01, 2008, 05:59:35 AM
I can't seem to get rid of it..

(http://img214.imageshack.us/img214/328/helpft0.jpg)

Appears on the 'Account Maintenance -> Order Information' page.

Help?

Thanks,

DC.
Title: Re: Annoying error above paypal button
Post by: marc7777 on October 30, 2008, 12:18:47 PM
I also have this problem, can anyone please help ????
Title: Re: Annoying error above paypal button
Post by: marc7777 on October 30, 2008, 14:28:31 PM
I found out where this Notice is coming from.
There is a table in in account.order_details.tpl.php

(components/com_virtuemart/themes/default/templates/pages/account.order_details.tpl.php)


<table width="100%">
  <tr>
    <td width="100%" align="center">
    <?php 
    @include( 
CLASSPATH"payment/".$dbpm->f("payment_class").".cfg.php" );

    echo DEBUG vmCommonHTML::getInfoField('Beginning to parse the payment extra info code...' ) : '';

    // Here's the place where the Payment Extra Form Code is included
    // Thanks to Steve for this solution (why make it complicated...?)
    if( eval('?>
' . $dbpm->f("payment_extrainfo") . '<?php ') === false ) {
     echo vmCommonHTML::getErrorField( "Error: The code of the payment method ".$dbpm->f( '
payment_method_name').' ('.$dbpm->f('payment_method_code').''
     .'
contains a Parse Error!<br />Please correct that first' );
    }
      ?>

    </td>
  </tr>
</table>


If I remove this block the Notice dissapears, also the PayPal logo dissapears.

Does any one know what this code actually does, and if it can be safely removed without causing problems during payment ?

I really need to know this asap as my site is about to go live.
Thanks,

Marc
Title: Re: Annoying error above paypal button
Post by: dan1234 on October 30, 2008, 14:36:53 PM
I didn't manage to fix the error, but I did hide it by placing an @ sign in front of the function and turning off error reporting. The paypal buttons seems to work perfectly.

Dan.
Title: Re: Annoying error above paypal button
Post by: yzedesign on November 19, 2008, 23:29:58 PM
Hi,
I work on this f... error and i find a solution with a little hack.  >:(

Problem comes from "paypal extra_info" on "$user->country" line 2 or 3:
$q = "SELECT country_2_code FROM #__vm_country WHERE country_3_code='".$user->country."' ORDER BY country_2_code ASC";

In checkout.thankyou, $user->country work well because "$user" is an object.

But in account.order_details to get the same information you must write $user[0]->country because "$user" is an array with an object inside.  :o

So the solution is to change :

if( eval('?>' . $dbpm->f("payment_extrainfo") . '<?php ') === false ) {
     echo vmCommonHTML::getErrorField( "Error: The code of the payment method ".$dbpm->f( '
payment_method_name').' ('.$dbpm->f('payment_method_code').''
     .'
contains a Parse Error!<br />Please correct that first' );
    }


By :

if( eval('?>' . str_replace("\$user->country","\$user[0]->country",$dbpm->f("payment_extrainfo")) . '<?php ') === false ) {
     echo vmCommonHTML::getErrorField( "Error: The code of the payment method ".$dbpm->f( '
payment_method_name').' ('.$dbpm->f('payment_method_code').''
     .'
contains a Parse Error!<br />Please correct that first' );
    }


Juste replace "$user->country" by "$user[0]->country" in payment_extrainfo

Hope it will be helpfull for you  ;D

A+ 8)