title notification -checkout and update - ordernumber

Open to all! Ask other shopowners for help.
Post Reply
User avatar
martindavinci
Member
Posts: 38
Joined: Mon Mar 08, 2021 8:33 am
Phoenix Version: 1.1.0.5
Has thanked: 2 times

title notification -checkout and update - ordernumber

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


Join The Code Co-op to get access to your library in the Code Co-op Forum
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: title notification -checkout and update - ordernumber

Post 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()
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: title notification -checkout and update - ordernumber

Post 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?
I am not here to build for you.
I am here to build with you. Let's help each other.
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: title notification -checkout and update - ordernumber

Post 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.
User avatar
martindavinci
Member
Posts: 38
Joined: Mon Mar 08, 2021 8:33 am
Phoenix Version: 1.1.0.5
Has thanked: 2 times

Re: title notification -checkout and update - ordernumber

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


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply