Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 02-19-2013 07:22:57

west4
Member
From: UK
Registered: 04-16-2008
Posts: 645
Website

Show Unit Price in confirmation emails?

Hi,

How do you include Unit price in the confirmation emails and displays, specifically in the ITEMS cell?

Code:

   // +--
               // | Print our item information cell.
               // +--

               if ($ship_type != 'NOTSHIPPED') {print '<td class="regtable" style="width: 50%">' . $eol;}
               elseif ($ship_count == 0)       {print '<td class="regtable" style="width: 100%">' . $eol;}
               else                            {print '<td class="regtable" style="width: 100%" colspan="2">' . $eol;}

               foreach ($ship_items as $key_num => $item_num) {

                    foreach ($order['items'] as $num => $item) {

                         if ($item_num == $item['id']) {

                              // +--
                              // | Print the item name.
                              // +--

                              if ($shownums) {$name = $item['itemname'] . ' - ' . $item['itemnum'];}
                              else           {$name = $item['itemname'];}

                              $name = $this->xhtml_encode($name);
                              $quan = $this->xhtml_encode($CORE_App->number_commify($item['itemquan']));

                              print '<p class="strong">' . $name . '</p>' . $eol;

                              // +--
                              // | Print options.
                              // +--

                              if (!(empty($item['cartdata']['optdisp']))) {

                                   $xodisp = '';

                                   foreach ($item['cartdata']['optdisp'] as $oname => $ovalue) {

                                        if (!(empty($ovalue))) {

                                              $oname  = $this->xhtml_encode($oname);
                                              $ovalue = $this->xhtml_encode($ovalue);

                                              $xodisp .= $oname . ': ' . $ovalue;

                                              if ($optlb) {$xodisp .= '<br />';} else {$xodisp .= '; ';}

                                        } // End of if statement.

                                   } // End of foreach statement.

                                   $xodisp = preg_replace('/\; $/','',$xodisp);
                                   $xodisp = preg_replace('/\<br \/\>$/','',$xodisp);

                                   if (!(empty($xodisp))) {print '<p>' . $xodisp . '</p>';}

                              } elseif (!(empty($item['itemopts']))) {

                                   print '<p>' . $this->xhtml_encode($item['itemopts']) . '</p>';

                              } // End of if statement.

Cheers,
Bruce.

Last edited by west4 (02-19-2013 07:28:10)


I'd rather have a full bottle in front of me, than a full frontal labotomy.

Offline

 

#2 02-19-2013 08:49:25

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Show Unit Price in confirmation emails?

I would add something like:

Code:

$unitprice = $item['ordertotal'] / $item['itemquan'];
$unitprice = $this->include_namespace('core','getprice',array('amount' => $unitprice, 'entrycurr'    => $currapp,  'returncurr'   => $currshow, 'formatwsym'   => 1, 'formatweutax' => 0));
$unitprice = $this->xhtml_encode($unitprice);

Don't use the last line (xhtml_encode) for the text email order summary.


Nick Hendler

Offline

 

#3 02-19-2013 10:29:38

west4
Member
From: UK
Registered: 04-16-2008
Posts: 645
Website

Re: Show Unit Price in confirmation emails?

Hi Nick,

any clue how to intergrate this code in my example:-)

Cheers,
Bruce.


I'd rather have a full bottle in front of me, than a full frontal labotomy.

Offline

 

#4 02-20-2013 07:11:43

west4
Member
From: UK
Registered: 04-16-2008
Posts: 645
Website

Re: Show Unit Price in confirmation emails?

Hi Nick,

Thanks That Worked....

here is my finished code for anyone that needs the unit price in checkout and confirmation emails...

(I stuck it in just after item name)...

Code:

.....................
               // +--
               // | Print our item information cell.
               // +--

               if ($ship_type != 'NOTSHIPPED') {print '<td class="regtable" style="width: 50%">' . $eol;}
               elseif ($ship_count == 0)       {print '<td class="regtable" style="width: 100%">' . $eol;}
               else                            {print '<td class="regtable" style="width: 100%" colspan="2">' . $eol;}

               foreach ($ship_items as $key_num => $item_num) {

                    foreach ($order['items'] as $num => $item) {

                         if ($item_num == $item['id']) {

                              // +--
                              // | Print the item name.
                              // +--

                              if ($shownums) {$name = $item['itemname'] . ' - ' . $item['itemnum'];}
                              else           {$name = $item['itemname'];}

                              $name = $this->xhtml_encode($name);
                              $quan = $this->xhtml_encode($CORE_App->number_commify($item['itemquan']));

                              print '<p class="strong">' . $name . '</p>' . $eol;
//+-
// print unit price bruce
//+-

$unitprice = $item['ordertotal'] / $item['itemquan'];
$unitprice = $this->include_namespace('core','getprice',array('amount' => $unitprice, 'entrycurr'    => $currapp,  'returncurr'   => $currshow, 'formatwsym'   => 1, 'formatweutax' => 0));
$unitprice = $this->xhtml_encode($unitprice);

print '<p class="strong">Unit Price: ' . $unitprice . '</p>' . $eol;

//+-
// end print unit price bruce
//+-

                              // +--
                              // | Print options.
                              // +--

                              if (!(empty($item['cartdata']['optdisp']))) {

                                   $xodisp = '';

                                   foreach ($item['cartdata']['optdisp'] as $oname => $ovalue) {

                                        if (!(empty($ovalue))) {

                                              $oname  = $this->xhtml_encode($oname);
                                              $ovalue = $this->xhtml_encode($ovalue);

                                              $xodisp .= $oname . ': ' . $ovalue;

                                              if ($optlb) {$xodisp .= '<br />';} else {$xodisp .= '; ';}

                                        } // End of if statement.

                                   } // End of foreach statement.

                                   $xodisp = preg_replace('/\; $/','',$xodisp);
                                   $xodisp = preg_replace('/\<br \/\>$/','',$xodisp);

                                   if (!(empty($xodisp))) {print '<p>' . $xodisp . '</p>';}

                              } elseif (!(empty($item['itemopts']))) {

                                   print '<p>' . $this->xhtml_encode($item['itemopts']) . '</p>';

                              } // End of if statement.

                              // +--
                              // | Print ship status.
                              // +--

.................

Cheers,
Bruce.

Last edited by west4 (02-20-2013 07:13:44)


I'd rather have a full bottle in front of me, than a full frontal labotomy.

Offline

 

#5 09-07-2016 09:53:48

sbhkma
Member
Registered: 05-17-2006
Posts: 448

Re: Show Unit Price in confirmation emails?

How would one do the same except for the account review - view/print orders? And would this add it to the order export for Quickbooks? Really need to be able to have unit price displayed vs just the total price.

Offline

 

#6 09-07-2016 10:21:34

west4
Member
From: UK
Registered: 04-16-2008
Posts: 645
Website

Re: Show Unit Price in confirmation emails?

Hi,

It is in my Print View and my Order Summery Review displays too.

So you need to edit Location: System Dashboard > System > Displays > Display Includes -- Order Summary (Order Confirmation)
and
Location: System Dashboard > System > Displays > Display Includes -- Order Summary (Printable XHTML Invoice)


I also added it to  Location: System Dashboard > System > Displays > Display Includes -- Order Summary (XHTML Mail) too.

and that should do it for the displays...

For Quickbooks you would have to add a 'unit price' field but I don't know how quickbooks export works, sorry...

Cheers,
Bruce.


I'd rather have a full bottle in front of me, than a full frontal labotomy.

Offline

 

#7 09-08-2016 10:24:22

sbhkma
Member
Registered: 05-17-2006
Posts: 448

Re: Show Unit Price in confirmation emails?

Thanks, Bruce. I owe you a bottle in front of you smile

Offline

 

#8 09-12-2016 13:44:21

sbhkma
Member
Registered: 05-17-2006
Posts: 448

Re: Show Unit Price in confirmation emails?

I'm stumped on where/how to put this in the Order Summary XHTML.

Last edited by sbhkma (09-12-2016 13:52:07)

Offline

 

#9 09-13-2016 02:43:29

west4
Member
From: UK
Registered: 04-16-2008
Posts: 645
Website

Re: Show Unit Price in confirmation emails?

Hi,

In the backend go to Location: System Dashboard > System > Displays > Display Includes and find 'Order Summary (XHTML Mail)' click UPDATE...
Then copy the code here...

Code:

               

//+-
// print unit price bruce
//+-

$unitprice = $item['ordertotal'] / $item['itemquan'];
$unitprice = $this->include_namespace('core','getprice',array('amount' => $unitprice, 'entrycurr'    => $currapp,  'returncurr'   => $currshow, 'formatwsym'   => 1, 'formatweutax' => 0));
$unitprice = $this->xhtml_encode($unitprice);

print '<p class="strong">Unit Price: ' . $unitprice . '</p>' . $eol;

//+-
// end print unit price bruce
//+-

and paste it between here...

Code:

               // +--
               // | Print our item information cell.
               // +--

               if ($ship_type != 'NOTSHIPPED') {print '<td class="regtable" style="width: 50%">' . $eol;}
               elseif ($ship_count == 0)       {print '<td class="regtable" style="width: 100%">' . $eol;}
               else                            {print '<td class="regtable" style="width: 100%" colspan="2">' . $eol;}

               foreach ($ship_items as $key_num => $item_num) {

                    foreach ($order['items'] as $num => $item) {

                         if ($item_num == $item['id']) {

                              // +--
                              // | Print the item name.
                              // +--

                              if ($shownums) {$name = $item['itemname'] . ' - ' . $item['itemnum'];}
                              else           {$name = $item['itemname'];}

                              $name = $this->xhtml_encode($name);
                              $quan = $this->xhtml_encode($CORE_App->number_commify($item['itemquan']));

                              print '<p class="strong">' . $name . '</p>' . $eol;

and here

Code:

                              // +--
                              // | Print options.
                              // +--

                              if (!(empty($item['cartdata']['optdisp']))) {

                                   $xodisp = '';

                                   foreach ($item['cartdata']['optdisp'] as $oname => $ovalue) {

                                        if (!(empty($ovalue))) {

                                              $oname  = $this->xhtml_encode($oname);
                                              $ovalue = $this->xhtml_encode($ovalue);

                                              $xodisp .= $oname . ': ' . $ovalue;

                                              if ($optlb) {$xodisp .= '<br />';} else {$xodisp .= '; ';}

                                        } // End of if statement.

hit the SUBMIT button and that should do it.

Cheers,
Bruce.

Last edited by west4 (09-13-2016 02:51:22)


I'd rather have a full bottle in front of me, than a full frontal labotomy.

Offline

 

Board footer