Specify a PHP 5 Function

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

ienabellamy
New php-forum User
New php-forum User
Posts: 1
Joined: Tue Oct 23, 2012 7:53 am

Specify a PHP 5 Function

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

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

validation.php

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

PaymentModule.php

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)
{CONTENT FUNCTION}



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!!

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

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


Return to “PHP coding => General”

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron