Override Functions

Is it possible to override one or several functions in the fn.* files?

I’m trying to override this function:

function fn_order_notification

There is no provision within cs-cart for overridding a function. However, there are hooks within that function that allow you to modify the data it will return.

OK. The problem with this function is not the return data, but it sends 2 emails within the function.

I want to add 2 attachments to these emails.

.

It's a bit annoying to make changes everytime an update is released.

Use this code hook:


('send_mail_pre', $mailer, $params, $area, $lang_code)


You can connect to the Mailer::sendMail method, and check if the e-mail is an order notification, so you can attach your files to the mail.


[quote name='ModNet' timestamp='1390552652' post='175925']

OK. The problem with this function is not the return data, but it sends 2 emails within the function.

I want to add 2 attachments to these emails.

.

It's a bit annoying to make changes everytime an update is released.

[/quote]

[quote name='drahos.istvan' timestamp='1390555742' post='175939']

Use this code hook:


('send_mail_pre', $mailer, $params, $area, $lang_code)


You can connect to the Mailer::sendMail method, and check if the e-mail is an order notification, so you can attach your files to the mail.

[/quote]



Sounds like a good idea. I will give it a try, thanks!