Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / General Questions / How to remove unwanted detail in Order Confirmation email?

How to remove unwanted detail in Order Confirmation email?

Started by athens_collectibles on 25 May 2012, 6:33 PM · Views: 2,342

Results 1 to 5 of 5
25 May 2012, 6:33 PM
#1
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

How to remove unwanted detail in Order Confirmation email?

Hello everyone,

On placing an order, the customer gets a confirmation email as per the example below (I have masked some fields because this is from a real order):


If you look at the products area, you will see the product title (underlined in red) and what I want to remove underlined in blue. This unwanted detail is actually the "Products Model" which I use as a SKU field.

I know (or so I think) that contents of the order confirmation email are defined in the includes/classes/order.php file but my knowledge of php is from non-existent to minimal and some help from an experienced fellow will be really appreciated.

Thanks in advance for any assistance and wishes for a nice weekend to all.

25 May 2012, 8:04 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: How to remove unwanted detail in Order Confirmation email?

Right file.
in v1.5.0 starting a line 906 you'll see this section:```
// build output for email notification
$this->products_ordered .= $this->products[$i]['qty'] . ' x ' . $this->products[$i]['name'] . [B]($this->products[$i]['model'] != '' ? ' (' . $this->products[$i]['model'] . ') ' : '') .[/B] ' = ' .
$currencies->display_price($this->products[$i]['final_price'], $this->products[$i]['tax'], $this->products[$i]['qty']) .
($this->products[$i]['onetime_charges'] !=0 ? "\n" . TEXT_ONETIME_CHARGES_EMAIL . $currencies->display_price($this->products[$i]['onetime_charges'], $this->products[$i]['tax'], 1) : '') .
$this->products_ordered_attributes . "\n";
$this->products_ordered_html .=
'<tr>' . "\n" .
'<td class="product-details" align="right" valign="top" width="30">' . $this->products[$i]['qty'] . ' x</td>' . "\n" .
'<td class="product-details" valign="top">' . nl2br($this->products[$i]['name']) . [B]($this->products[$i]['model'] != '' ? ' (' . nl2br($this->products[$i]['model']) . ') ' : '') .[/B] "\n" .

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

26 May 2012, 3:01 PM
#3
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Re: How to remove unwanted detail in Order Confirmation email?

A million thanks DrByte, it worked perfectly!

Can I trouble you with another two questions please?

  1. How can I remove the extra line feed underneath the product price?
  2. How can I remove the (Shipping to >> Greece) from the Shipping method block below the Delivery address?

Following your previous instructions, I fiddled with various lines of the includes/classes/order.php file trying to find the solution myself, but with no success :blush: but I suspect that it will again be something easy. The new order confirmation displays below:

Thank you in advance again and have a nice evening.

26 May 2012, 4:48 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: How to remove unwanted detail in Order Confirmation email?

I suspect your blank line can be removed from the raw HTML of the email template file in your /email/ folder.

And the shipping name comes from your shipping module.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

26 May 2012, 7:10 PM
#5
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Re: How to remove unwanted detail in Order Confirmation email?

Yes, the blank line was caused by some padding in the html email and this is now fixed.

As for the shipping name, it does come from the shipping module but I was trying to get rid of the second part only (the one in parentheses). Anyway, I shortened both parts of that line in the module and the whole text does not overflow to a second line now, improving the overall appearance.

Once more, I thank you for your assistance and wish you a nice evening. :D