Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Specify a PHP 5 Function

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Specify a PHP 5 Function

Postby ienabellamy » Tue Oct 23, 2012 7:56 am

Hello ! i've this portion of code in a file:


Code: Select all
$paypal->validateOrder($_POST['custom'], _PS_OS_PAYMENT_, $price, $paypal->displayName, $paypal->getL('transaction').$_POST['txn_id']);

That function is declared in another file


Code: Select all
public function validateOrder($id_cart, $id_order_state, $amount_paid, $payment_method = 'Unknown',
$message = null, $extra_vars = array(), $currency_special = null, $dont_touch_amount = false,
$secure_key = false, Shop $shop = null)

I want that $paypal->validateOrder calls another file, for example PaymentModuleMod.php that will contains the same function little modified.

in which way can i do this ? and for just curiosity, in which way the system KNOWS that validateOrder() is in PaymentModule.php ? is that $paypal-> that specify this ?

Thanks, i'm trying to modify some Prestashop's modules ;) Thanks to ALL!!
New php-forum User
New php-forum User
Posts: 1
Joined: Tue Oct 23, 2012 7:53 am

Re: Specify a PHP 5 Function

Postby seandisanti » Tue Oct 23, 2012 1:09 pm

the other files would be required or included along the way by other scripts in the library.the easiest thing to do would be to find the file that contains the function you're looking to overload, and then go into it an comment the old function and write your own. or comment it and include a file that has your version from that file
php-forum Fan User
php-forum Fan User
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.