That Software Guy, Inc.'s Logo

Software Consulting Services
Need Help? Call That Software Guy!


newsletter discounts

Newsletter Discount

Newsletter Discount is a Zen Cart™ discounting module which allows you to offer reduced prices for newsletter subscribers. It can be configured to work with the native Zen Cart newsletter facility or with MailChimp.

Relevance: Zen Cart™ 1.3.5 and forward

Cost: Free, but donation appreciated

Location: Zen Cart Downloads page, under Pricing Tools.

Download: Newsletter Discount on Zen Cart Downloads Page

Current Version: 1.1

Support Thread: Newsletter Discount Support Thread

FAQ: click here

Installation: click here

Overview:

Newsletter Discount allows you to offer a percentage discount on purchases made by someone who has signed up for your newsletter.

Newsletter Discount is an order total module; it only shows up on the second page of checkout.


Payment Page displaying Newsletter Discount

Payment page showing Newsletter Discount



Installation Instructions:

  1. Back up everything! Try this in a test environment prior to installing it on a live shop.
  2. Copy the contents of the unzipped folder to the root directory of your shop.
  3. Login to admin and in Modules->Order Total you will see 'Newsletter Discount' listed along with all the other modules available.
  4. Click on 'Newsletter Discount' to highlight the module and click on 'Install'
  5. Set the parameters according to your discounting plan.
  6. If you wish, follow the guidelines in marketing to advertise your discounts.


Configuration:

Some shops will want to further customize their discounting policy. User exits are provided to permit the following customizations:
  • Include or exclude certain categories from discounting.
  • Include or exclude certain products from discounting.


Specifically:

  • The function exclude_category() shows you how to add categories to a list of categories to not be discounted.
  • The function exclude_product() shows you how to add products to a list of products to not be discounted.

Each of these functions contains a simple example of how to use it using item and category numbers like 99999, 99998, etc. Note that the "category" of an item is its parent category; see my category explanation page for an explanation. Note that to use the category exclusions you must be running Zen Cart 1.3.5 or greater.

The user exits are in includes/modules/order_total/ot_newsletter_discount.php.

MailChimp

MailChimp

MailChimp is an Email Service Provider; their business is managing commercial email. They have a very reasonable per-email cost model (unlike firms like Constant Contact, which charge per month irrespective of how little mail you send). You can integrate MailChimp into your Zen Cart using the MailChimp Newsletter contribution.

The Newsletter Discount contribution uses the MailChimp API to communicate with MailChimp and determine whether the customer is a newsletter subscriber.

Configuration of Newsletter Discounts when using MailChimp:
  • In Admin->Modules->Order Total->Newsletter Discount, You must set the Newsletter Type to "mailchimp" and fill in the MailChimp Userid and MailChimp Password.
  • By default, all MailChimp lists you have set up are scanned. If you want to use one list only, look for the line
                 $id = $lists[$i]['id'];
    
    and change it to
                 if ($lists[$i]['name'] != 'Your-Newsletter-List-Name') continue;
                 $id = $lists[$i]['id'];
    
    Change Your-Newsletter-List-Name to the actual name of your list


Marketing

A discounting plan reaches maximum effectiveness through advertising.

Customize the tpl_product_info_display.php file to advertise your discounts. Put the file

includes/templates/template_default/templates/tpl_product_info_display.php

into includes/templates/<Your Template>/templates, and add this block of code to the page:
<?php 
  $value = "ot_newsletter_discount.php";
  include_once(zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] .
          '/modules/order_total/', $value, 'false'));
  include_once(DIR_WS_MODULES . "order_total/" . $value);
  $discount = new ot_newsletter_discount();
  echo '<div class="content" id="discountPolicy">';
  $resp = $discount->get_html_policy(); 
  echo $resp;
  echo '</div>';
  echo '<br class="clearBoth" />'; 
?>
The placement of this code is a matter of personal preference; try placing it below the product description and adjust to your tastes.

You can put this code whereever you'd like. For example, here I have placed it in tpl_modules_create_account.php so that new signups see the policy when making their newsletter choice:

Signup page showing Newsletter Discount


Files

(new)includes/languages/english/modules/order_total/ot_newsletter_discount.php
(new)includes/modules/order_total/ot_newsletter_discount.php
(new)includes/classes/MCAPI.class.php


Learning More about Newsletters

MailChimp provides some excellent resources to help you learn about newsletters, whether or not you use their service. Start with their 65 Page Email Marketing Guide. Then take a look at their Resource Center.

To learn more about the value proposition of the MailChimp service, go to their features and benefits page.

FAQ

Q: I'm using exclude_category() and it's not working!
A: Please see the Category Issues page for solutions.

Q: I do not want to discount products 12 and 13. How do I do this?
A: Update the function exclude_product() in includes/modules/order_total/ot_quantity_discount.php as follows:
    function exclude_product($prid) {
        $id = (int)$prid;
        switch($id) {
           case 12:
           case 13:
                return true;
        }
        return false;
    }


Q: I only want discounts applied to items in category 11. How do I do this?
A: Update the function exclude_category() in includes/modules/order_total/ot_newsletter_discount.php as follows:
    function exclude_category($category) {
        switch($category) {
           case 11:
                return false;
        }
        return true;
    }


Q: I don't want discounts applied to items in category 7. How do I do this?
A: Update the function exclude_category() in includes/modules/order_total/ot_newsletter_discount.php as follows:
    function exclude_category($category) {
        switch($category) {
           case 7:
                return true;
        }
        return false;
    }








If the information you learned reading this site is helping your store make more money, please consider making a donation. Thank you!



Want more Zen Cart?     Tips and Tricks     Contributions     Extensions     Custom Software     Newsletter

   Terms | Privacy | SiteMap | Newsletter | Contact Me | ©2003-2008 That Software Guy, Inc.