How to list the products in the Order Update email

Open to all! Ask other shopowners for help.
Post Reply
ArtcoInc
Contributor
Posts: 119
Joined: Fri Oct 25, 2019 4:19 pm
Phoenix Version: v1.0.3.0
Has thanked: 86 times
Been thanked: 17 times

How to list the products in the Order Update email

Post by ArtcoInc »

When a customer places an order, checkout_process.php generates an Order Acknowledgement email, listing the products ordered.

When the administrator updates the order in admin/orders.php, there is the option to send an Order Update email to the customer. This email is rather plain, and I am trying to revise it.

I am trying to include the items purchased, like in the Order Acknowledgement email. The list of items purchased is available in admin/orders.php, as they are displayed onscreen. However, I have not found a way to include that list in the Orders Update email.

I am trying this bit of code (which is similar to the code to display the products onscreen), but it is not working in the email

Code: Select all

    for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
        $email .= $order->products[$i]['name'] ;
    }
Any ideas?

Thanks in advance!

Malcolm
Last edited by ArtcoInc on Sat Feb 07, 2026 10:24 pm, edited 1 time in total.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4546
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: How to ist the products in the Order Update email

Post by burt »

The Order Update email logic in your version is in the top of admin/orders.php
At the point that this email is made, the order data is not actually available.

The few bits available (for that email) are;

customers_name, customers_email_address, orders_status, date_purchased

You should try;

1. include the order class, higher up in the same file, current location L169
2. instantiate an order object in the update_order action loop (see L197, but leave that where it is, just do simillar)
I am not here to build for you.
I am here to build with you. Let's help each other.
ArtcoInc
Contributor
Posts: 119
Joined: Fri Oct 25, 2019 4:19 pm
Phoenix Version: v1.0.3.0
Has thanked: 86 times
Been thanked: 17 times

Re: How to list the products in the Order Update email

Post by ArtcoInc »

@burt

Thank you.
1) I moved the call to the order class (old L169) to the top of the file (old L14)
2) I copied the instantiate (old L197) into the top of the update_order action loop (insert above old L32)

No joy :(

Malcolm
ArtcoInc
Contributor
Posts: 119
Joined: Fri Oct 25, 2019 4:19 pm
Phoenix Version: v1.0.3.0
Has thanked: 86 times
Been thanked: 17 times

Re: How to list the products in the Order Update email

Post by ArtcoInc »

*** Success ***

I just had to find the right place to move the instantiate to ...

Just after:

Code: Select all

if ( ($check_status['orders_status'] != $status) || tep_not_null($comments)) {

(below old L40).

Thank you again!
ArtcoInc
Contributor
Posts: 119
Joined: Fri Oct 25, 2019 4:19 pm
Phoenix Version: v1.0.3.0
Has thanked: 86 times
Been thanked: 17 times

Re: How to list the products in the Order Update email

Post by ArtcoInc »

Thank you, Gary! @burt

I'm now working on having the email content dependent on the order status (ie: different content when the status is changed to Shipped), and adding some HTML styling (a topic for another discussion).

This requires me to edit /admin/orders.php (at least, in v1.0.3.0), which is a "core file". You know me ... I don't have a problem with that. But, looking ahead ...

When I look at the latest version of Phoenix (1.1.0.6) ...

1) Where is the customer's "Order Update' email defined?

2) Is there a template, or override, system in place in admin, to allow for the override of the email style, without editing a "core file"?

TIA
User avatar
burt
Core Team
Posts: 4546
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: How to list the products in the Order Update email

Post by burt »

1. In 1106 it's a module.
Your Admin > Modules > Notifications
Which means shopowner could turn the Core Module off and make their own, then install the one they made.
I think there are some Notification Modules floating about somewhere.

2. Or...instead of making a new Module, you could override the Core Modules TPL file (though I have not tried this)
/{whatever_template}/includes/modules/notifications/tpl_n_update_order.php

--

For reference, most (not all) things that are Modules have a TPL file.
TPL files can always be overridden in `whatever_template` the user has live.
I am not here to build for you.
I am here to build with you. Let's help each other.


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