User Tools

Site Tools


zencartmods

This is an old revision of the document!


Improving Coupon Reports

Want to know how much was 'saved' by your customers by using a discount coupon? Here is a mod for v1.38 that will add it in the Admin coupon report. Enjoy :)

in admin/coupon_admin.php change lines 455+ to the following, adding the two statements marked "START MOD" and "END MOD"

<?php
    $heading = array();
    $contents = array();
      $coupon_desc = $db->Execute("select coupon_name
                                   from " . TABLE_COUPONS_DESCRIPTION . "
                                   where coupon_id = '" . $_GET['cid'] . "'
                                   and language_id = '" . $_SESSION['languages_id'] . "'");
      $count_customers = $db->Execute("select * from " . TABLE_COUPON_REDEEM_TRACK . "
                                       where coupon_id = '" . $_GET['cid'] . "'
                                       and customer_id = '" . $cInfo->customer_id . "'");
// START MOD
      $coupon_saved = $db->Execute("SELECT sum(value) as saved FROM " . TABLE_COUPON_REDEEM_TRACK . ", " . TABLE_ORDERS_TOTAL . " WHERE coupon_id = " . $_GET['cid'] . " AND orders_id = order_id AND class = 'ot_coupon'");
// END MOD
      $heading[] = array('text' => '<b>[' . $_GET['cid'] . ']' . COUPON_NAME . ' ' . $coupon_desc->fields['coupon_name'] . '</b>');
      $contents[] = array('text' => '<b>' . TEXT_REDEMPTIONS . '</b>');
//      $contents[] = array('text' => TEXT_REDEMPTIONS_TOTAL . '=' . $cc_list->RecordCount());
      $contents[] = array('text' => TEXT_REDEMPTIONS_TOTAL . '=' . $cc_query_numrows);
      $contents[] = array('text' => TEXT_REDEMPTIONS_CUSTOMER . '=' . $count_customers->RecordCount());
// START MOD
      $contents[] = array('text' => TEXT_REDEMPTIONS_SAVED . '=' . $coupon_saved->fields['saved']);
// END MOD
      $contents[] = array('text' => '');
?>

Allowing + in email

Line 548 of includes/functions/functions_email.php

$valid_email_pattern = '^[a-z0-9]+[a-z0-9_\.\'\-\+]*@[a-z0-9]+[a-z0-9\.\-]*\.(([a-z]{2,6})|([0-9]{1,3}))$';

Adding a barcode to invoices

Barcodes on invoices can be very handy if you have an automated shipping system. This mod will show you how to do that with only one line of added code to invoice.php. You'll need a barcode generator, this public domain code snipped by Charles J. Scheffold is ten years old and works great :)

Download barcode.php.zip and uncompress it, upload the barcode.php file to your zencart/admin directory

Then we can call this code to make a barcode image wherever we want! Open up admin/invoice.php and stick this line where ever you want the barcode

We suggest:

find line 48 of invoice.php

<!-- body_text //-->

and replace it with:

<!-- body_text //-->
<?php echo '<img src="barcode.php?barcode=' . $oID . '&width=250&height=50" />'; ?>;
/home/ladyada/public_html/wiki/data/attic/zencartmods.1301524220.txt.gz · Last modified: 2016/01/28 18:05 (external edit)