Post by beea » Thu Jan 26, 2012 5:05 pm

I noticed that the code used for discount coupon or gift voucher is always displayed in brackets in the invoice generated after a purchase is made. Does anyone know how I can remove the code from the invoice? I searched the order_invoice.tpl but there wasn't anything there to amend or delete. I then went to search in the controller/sale/order.php but the programming there is beyond me. Any help is greatly appreciated.

Newbie

Posts

Joined
Thu Jan 26, 2012 4:54 pm

Post by jty » Fri Jan 27, 2012 9:48 pm

Is it controlled by admin > Extensions > Totals ?
If you turn it off there, does it still show on the invoice
I'm looking at the block of code in the order_invoice.tpl and it looks like it's coming from the totals
This bit

Code: Select all

<?php foreach ($order['total'] as $total) { ?>
    <tr>
      <td align="right" colspan="4"><b><?php echo $total['title']; ?>:</b></td>
      <td align="right"><?php echo $total['text']; ?></td>
    </tr>
    <?php } ?>

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by beea » Sat Jan 28, 2012 6:58 am

Hi jty, yes, its from this portion of order_invoice.tpl. However, if I turn this part off, all the titles for "Sub-total" and "Total" will also be gone. I only want to turn off the display of the discount code I've issued my customer for their coupon or voucher. They appear right now in brackets. (see attached image, the part underlined in red). This discount code also appears in the email sent to my customer after they make a purchase and I do not wish them to see this code for security reasons. Any help and ideas greatly appreciated. :)

Attachments

invoice.PNG

invoice.PNG (4.28 KiB) Viewed 3742 times


Newbie

Posts

Joined
Thu Jan 26, 2012 4:54 pm

Post by adisoftronics » Sat May 17, 2014 3:58 pm

go to /admin/view/template/dale/order_invoice.tpl

now look at the line where it echo $total['title']

replace echo $total['title'] with the code given below and you can do the same for other codes too. ;)

if (substr($total['title'],0,6)=='Coupon')
{

echo 'Coupon';}
else{
echo $total['title'];
}

Newbie

Posts

Joined
Sat May 17, 2014 3:56 pm

Post by panagos » Mon Jan 04, 2016 5:59 am

Hi guys

I am happy to report that I have just published a new extension which deals with exactly this issue. It works for both voucher numbers and coupon codes. This plugin is compatible with and has been tested successfully with opencart 1.5.x.x as well as 2.x.x.x

http://www.opencart.com/index.php?route ... n_id=25235

On top of this the behaviour can be controlled on the admin section of the default store, i.e. you can choose to show or hide coupon codes and or voucher numbers on the invoices.

Furthermore, the extension applies to the following use cases:
a) Email sent by the system when order is placed
b) Customer viewing order history
c) Admin printing an invoice.

Hope you guys find it useful.

Note: The modifications apply to opencart's controller and models and thus should not require any modifications to your store's themes.

Rgds
Soteri

--
Soteri Panagou
Freelance Developer and Opencart Zealot

http://www.opencart.com/index.php?route ... @gmail.com


New member

Posts

Joined
Sun Oct 25, 2015 3:01 am


Post by panagos » Mon Jan 04, 2016 1:34 pm

Guys

I am happy to report that following a suggestion from a fellow opencart user, I have extended my plugin to now allow for controlling whether or not vouchers numbers/coupon codes must be displayed on the checkout screen (last step).

http://www.opencart.com/index.php?route ... n_id=25235

Rgds
Soteri

--
Soteri Panagou
Freelance Developer and Opencart Zealot

http://www.opencart.com/index.php?route ... @gmail.com


New member

Posts

Joined
Sun Oct 25, 2015 3:01 am

Who is online

Users browsing this forum: No registered users and 5 guests