Page 1 of 1

title notification -checkout and update - ordernumber

Posted: Thu Jan 30, 2025 2:30 pm
by martindavinci
1.0.8.19 PHP8.0
Is it possible, as in previous versions, to put the order number in the title of the notification (email to the customer, but also to the admin)? I have already tried different ways, after visiting the different forums, in n_ckeckout.php, but can't get it done.
Has anyone already succeeded? Would be great!

Re: title notification -checkout and update - ordernumber

Posted: Thu Jan 30, 2025 4:00 pm
by heatherbell
martindavinci wrote: Thu Jan 30, 2025 2:30 pm Is it possible to put the order number in the title of the notification (email to the customer, but also to the admin)? I have already tried different ways, after visiting the different forums, in n_ckeckout.php, but can't get it done.
Precisely what do you want to change - what do you mean by "title".
The code that would output the order number can be seen here:
https://github.com/CE-PhoenixCart/Phoen ... ut.php#L16

Code: Select all

$order->get_id()

Re: title notification -checkout and update - ordernumber

Posted: Thu Jan 30, 2025 4:14 pm
by burt
I think you're asking to change the title of the outgoing email ? I am not sure if that part of the email can be *easily* changed, so here is a way that involves some code manipulation. Extra bits of code in RED


https://github.com/CE-PhoenixCart/Phoen ... ut.php#L16

to;

const MODULE_NOTIFICATIONS_CHECKOUT_TEXT_SUBJECT = 'Order Process %s';


AND

https://github.com/CE-PhoenixCart/Phoen ... ut.php#L58

to

$accepted = Notifications::mail($order->customer['name'], $order->customer['email_address'], sprintf(MODULE_NOTIFICATIONS_CHECKOUT_TEXT_SUBJECT, $order->get_id()), $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

Similar change on L62 of same file.

Not tested. Try it?

Re: title notification -checkout and update - ordernumber

Posted: Thu Jan 30, 2025 4:39 pm
by heatherbell
So, if it is the email "subject" that is desired to be changed to include the order number, this works:
In /includes/modules/notifications/n_checkout.php
change both instances of:

Code: Select all

MODULE_NOTIFICATIONS_CHECKOUT_TEXT_SUBJECT
to

Code: Select all

MODULE_NOTIFICATIONS_PSI_CHECKOUT_TEXT_SUBJECT . " #" . $order->get_id()
In /includes/modules/notifications/n_update_order.php
change:

Code: Select all

MODULE_NOTIFICATIONS_UPDATE_ORDER_TEXT_SUBJECT
to

Code: Select all

MODULE_NOTIFICATIONS_UPDATE_ORDER_TEXT_SUBJECT . " #" . $order->get_id()
Of course, this changes core files so really, you need to create a new module so it is not overwritten in updates.

Re: title notification -checkout and update - ordernumber

Posted: Thu Jan 30, 2025 4:44 pm
by martindavinci
Burt,
Exactly what the intention is! Fantastic, it saves a fair amount of work in practice (the notification can now be used as a work order because it corresponds to the list in my mail program).
My heartfelt thanks!