User Tools

Site Tools


tutorials:zencartmods:addrmismatchinv.html

Quickly identify Billing/Shipping Address mismatch

When a customer's billing and shipping address don't match, it can be anything from a gift purchase to straight up fraud. This will put a big red box around it whenever this happens. NOTE: This does not validate the addresses themselves, only that they don't match each other.

admin/invoice.php

Find (line 117)

            <td class="main"><?php echo zen_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td>

replace with

<td  class="main"
<?php 
        $boxit = false;
 
if ( ($order->delivery['name'] != $order->billing['name']) ||
     ($order->delivery['state'] != $order->billing['state']) ||
     ($order->delivery['city'] != $order->billing['city']) ||
     ($order->delivery['country'] != $order->billing['country']) )
     {
  $boxit = true;
}
if ($boxit) {
  print  'style="border:solid 4px #FF0000"';
}
?>
 >
<?php echo zen_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?>
</td>
/home/ladyada/public_html/wiki/data/pages/tutorials/zencartmods/addrmismatchinv.html.txt · Last modified: 2016/01/28 18:05 (external edit)