This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
zencartmods [2011/03/30 22:23] daigo |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== 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" | ||
- | |||
- | <code php> | ||
- | <?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' => ''); | ||
- | ?> | ||
- | </code> | ||
- | |||
- | ===== Allowing + in email ===== | ||
- | Line 548 of includes/functions/functions_email.php | ||
- | <code> | ||
- | $valid_email_pattern = '^[a-z0-9]+[a-z0-9_\.\'\-\+]*@[a-z0-9]+[a-z0-9\.\-]*\.(([a-z]{2,6})|([0-9]{1,3}))$'; | ||
- | </code> | ||
- | |||
- | |||
- | ===== Adding a barcode to invoices ===== | ||
- | |||
- | |||
- | upload | ||
- | {{:barcode.php.zip|barcode.php }} | ||
- | into /admin | ||
- | |||
- | |||
- | Copy this into admin/invoice.php where ever you want the barcode | ||
- | |||
- | <code php> | ||
- | <?php echo '<img src="barcode.php?barcode=' . $oID . '&width=250&height=50" />'; ?>; | ||
- | </code> |