If this is your first visit, check our documentation. To post, register or login.
Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Remove/Hide Discount Coupon Code from Order Confirmation Emails

Remove/Hide Discount Coupon Code from Order Confirmation Emails

Started by emovendo on 5 Jul 2012, 3:32 PM · Views: 1,904

Results 1 to 3 of 3
5 Jul 2012, 3:32 PM
#1
emovendo avatar

emovendo

New Zenner

Join Date:
Jul 2011
Posts:
4
Plugin Contributions:
0

Remove/Hide Discount Coupon Code from Order Confirmation Emails

Hello,

We process a number of orders by phone on behalf of customers and often offer them bulk discounts. The % of the discounts vary.

After taking their CC info, We enter their info thorough our website just as a regular customer would do.

We have set-up discounts by using Coupon Codes starting with free S&H and and then adding a free S&H + 1% discount code, free S&H + 2% discount, etc. (We are using the Discount_Coupons_Combo 1.39 version as posted by Ajeh)

However, we want the codes to remain purely internal. We do not plan to offer coupons to our customers for their own use, so hiding the codes from the invoice is not an issue.

If additional information is need, please ask.

5 Jul 2012, 8:38 PM
#2
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Remove/Hide Discount Coupon Code from Order Confirmation Emails

your going to want to edit admin/invoice.php. The bit that you are interested in is :

<?php
  for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
    echo '          <tr>' . "\n" .
         '            <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Text">' . $order->totals[$i]['title'] . '</td>' . "\n" .
         '            <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $order->totals[$i]['text'] . '</td>' . "\n" .
         '          </tr>' . "\n";
  }
?>

It loops through all the order totals and prints them out. If you want to exclude one of them then something like:

<?php
  for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
  if($order->totals[$i]['title'] != 'Title to Exclude')
  {
    echo '          <tr>' . "\n" .
         '            <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Text">' . $order->totals[$i]['title'] . '</td>' . "\n" .
         '            <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $order->totals[$i]['text'] . '</td>' . "\n" .
         '          </tr>' . "\n";
  }
  }
?>

You'll have to change where it says 'Title to Exclude' to the title of the order total you need to exclude.

I would say though that it is better to just change the titles to something customer friendly so that they know they are getting discounts.

And having written this post I realise that that will make the totals not add up. You may just want to change the title itself rather than exlude the whole row? In which case you'd use the same technique but put it around the title rather than the whole thing.

Nick
iszent.com

31 Jul 2012, 6:49 PM
#3
discoverytdi avatar

discoverytdi

Totally Zenned

Join Date:
May 2011
Location:
Sunny Rossendale (not)
Posts:
562
Plugin Contributions:
0

Re: Remove/Hide Discount Coupon Code from Order Confirmation Emails

I have a similar question I'd like to hide the actual code from both emails and invoices as I have a discount code set up for phone orders and I don't want this code in public view all you would see in the invoice and email is something like this:

Widget £15.99
Discount No code showing £2.00
Total £13.99
can this be done

What ever your doing remember to KISS ( Keep It Simple Stupid )