News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Annoying error above paypal button

Started by dan1234, September 01, 2008, 05:59:35 AM

Previous topic - Next topic

dan1234

I can't seem to get rid of it..



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

Help?

Thanks,

DC.

marc7777

I also have this problem, can anyone please help ????

marc7777

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

dan1234

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.

yzedesign

#4
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)