There doesn’t seem to be a place to add coupon code when editing orders.
Pain in the butt when customers forget to enter the coupon code and bug you about it.
Here’s how to enable coupon code field.
1. Modify totals.tpl
path: skins/basic/admin/views/order_management/totals.tpl
change:
{if !$cart.order_id}<br />
<div class="form-field"><br />
<label for="coupon_code">{$lang.discount_coupon_code}:</label><br />
<input type="text" name="coupon_code" id="coupon_code" class="input-text-large" size="30" value="" /><br />
</div><br />
{/if}<br />
```<br />
<br />
to:<br />
<br />
```php
{if $cart.order_id}<br />
<div class="form-field"><br />
<label for="coupon_code">{$lang.discount_coupon_code}:</label><br />
<input type="text" name="coupon_code" id="coupon_code" class="input-text-large" size="30" value="" /><br />
</div><br />
{/if}<br />
```<br />
<br />
<br />
The above will show the coupon code field in the step 3 of 'edit order'.<br />
<br />
<br />
[B]2. Modify order_management.php<br />
[/B]<br />
path: controllers/admin/order_management.php<br />
<br />
<br />
Change:<br />
<br />
```php
// Apply coupon<br />
if (!empty($_REQUEST['coupon_code'])) {<br />
$cart['pending_coupon'] = $_REQUEST['coupon_code'];<br />
}<br />
```<br />
<br />
To:<br />
<br />
```php
// Apply coupon<br />
if (!empty($_REQUEST['coupon_code'])) {<br />
$cart['pending_coupon'] = $_REQUEST['coupon_code'];<br />
$cart['recalculate'] = true;<br />
}<br />
```<br />
<br />
<br />
[B]3. Modify fn.cart.php<br />
[/B]<br />
path: core/fn.cart.php<br />
<br />
Change:<br />
<br />
```php
// Apply cart promotions<br />
if ($apply_cart_promotions == true && $cart['subtotal'] > 0 && empty($cart['order_id'])) {<br />
fn_promotion_apply('cart', $cart, $auth, $cart_products);<br />
}<br />
```<br />
<br />
To:<br />
<br />
```php
// Apply cart promotions<br />
if ($apply_cart_promotions == true && $cart['subtotal'] > 0) {<br />
if ( (AREA == 'A') || empty($cart['order_id']) ) {<br />
fn_promotion_apply('cart', $cart, $auth, $cart_products);<br />
}<br />
}<br />
```<br />
<br />
The above will apply promotions if the AREA is in the admin or if there is no order_id.