If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Replace "model" with "id" on confirmation email

Replace "model" with "id" on confirmation email

Locked

Started by mkopecky on 15 Oct 2008, 7:15 PM · Views: 2,148

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
15 Oct 2008, 7:15 PM
#1
mkopecky avatar

mkopecky

New Zenner

Join Date:
Aug 2007
Posts:
31
Plugin Contributions:
0

Post #1 by mkopecky

I want to replace the product model number with the id number on our confirmation emails. We are using 1.3.8. In searching the forum I found the file I need to manipulate and I thought it was as easy as swapping out "model" for "id" in the following code found in /orders.php

// build output for email notification
$this->products_ordered .= $this->products[$i]['qty'] . ' x ' . $this->products[$i]['name'] . ($this->products[$i]['model'] != '' ? ' (' . $this->products[$i]['model'] . ') ' : '') . ' = ' .
$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']) . ($this->products[$i]['model'] != '' ? ' (' . nl2br($this->products[$i]['model']) . ') ' : '') . "\n" .
'<nobr><small><em> '. nl2br($this->products_ordered_attributes) .'</em></small></nobr></td>' . "\n" .
'<td class="product-details-num" valign="top" align="right">' .
$currencies->display_price($this->products[$i]['final_price'], $this->products[$i]['tax'], $this->products[$i]['qty']) .
($this->products[$i]['onetime_charges'] !=0 ?
'</td></tr>' . "\n" . '<tr><td class="product-details">' . nl2br(TEXT_ONETIME_CHARGES_EMAIL) . '</td>' . "\n" .
'<td>' . $currencies->display_price($this->products[$i]['onetime_charges'], $this->products[$i]['tax'], 1) : '') .
'</td></tr>' . "\n";

When I substituted model with id the confirmation email came through with the id number, but it also had a very long strand of numbers ( I think it is a dynamic number?)
Example:
1 x White Flower Bouquet Greeting Card
(467:b785de45eaf576fa2936017903ee1323) = $4.45
Bouquet Tag Message Get Well

I am clearly an amateur and know it is probably an easy fix, but can't figure it out how to just have the id number "467" appear without the long strand of numbers.

Any help or advice would be fantastic.
Thanks,
mkopecky

16 Oct 2008, 6:28 AM
#2
drbyte avatar

drbyte

Sensei

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

Post #2 by drbyte

if you're using "$this->products[$i]['id']" for your product ID, a very fast way to drop the attribute-specific hash off the end of the number is to add "(int)" in front of it: "(int)$this->products[$i]['id']"

.
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.

17 Oct 2008, 9:07 PM
#3
mkopecky avatar

mkopecky

New Zenner

Join Date:
Aug 2007
Posts:
31
Plugin Contributions:
0

Post #3 by mkopecky

That worked. Thanks for the easy hint!:clap: