AwoCoupon for redSHOP - User Guide


Introduction
AwoCoupon for redSHOP was created to enchance the coupon capabilities of redSHOP. Some of the features within AwoCoupon include:
  • Product(s) specific discounts
  • Customer(s) specific discounts
  • The ability to only trigger coupons if a minimum cart total is reached
  • Ability to set expiration dates for coupons
  • Restrict the number of times a coupon can be used by any given user
  • Easy management of all coupons
  • Gift Certificate style coupons
Installation
Backup your code before starting this installation process. This is a 2 step process. First the component is installed, then the redSHOP source code is edited. If the second part of the installation is not completed for some reason then knowledge of php code as well as write access to your joomla source code will be needed. Please read through the instructions carefully.
System requirements
Joomla 1.5, redSHOP 1.x
Step 1 - AwoCoupon Installation
1.   Download AwoCoupon to a location on your computer
2.   Log into Joomla as an Administrator
3.   From the top menu go to Extensions->"Install/Uninstall"
4.   Under the "Upload Package File" section press the button "Browse..."
5.   Find and select the file, com_awocouponrs.zip, downloaded to your computer
6.   Install component by pressing "Upload File & Install" button
7.   You will receive a page telling you the status of step 1 and step 2. If step 2 was successful, you are done, if not, please follow instructions below for step 2. (if unsuccessful, see Section 7. Troubleshooting)
Step 2 - redSHOP Installation (ONLY if Unsuccessful)
This section requires the user to have access to the website files for edit. You may need to use an ftp client to access the files.
1.   Open the file $webroot/components/com_redshop/models/checkout.php
2.   Locate this code (around line 552):
PHP Code:
if (! $couponItems->store ()) {
    
$this->setError ( $this->_db->getErrorMsg () );
    return
false;
}
      And change it to this:
PHP Code:
$awo_file = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_awocouponrs'.DS.'helpers'.DS.'rs_coupon.php';
if(
file_exists($awo_file)) {
    require_once
$awo_file;
    
rs_coupon::add_giftcert_code($couponItems);
} elseif (!
$couponItems->store ()) {
    
$this->setError ( $this->_db->getErrorMsg () );
    return
false;
}
3.   Locate this code (around line 1600):
PHP Code:
function coupon()
      And change it to this:
PHP Code:
function coupon(){
    
$awo_file = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_awocouponrs'.DS.'helpers'.DS.'rs_coupon.php';
    if(
file_exists($awo_file)) {
        require_once
$awo_file;
        return
rs_coupon::remove_coupon_code();
    }
    return
$this->coupon_rs();
}
function
coupon_rs()
4.   Open the file $webroot/components/com_redshop/helpers/cart.php
5.   Locate this code (around line 552):
PHP Code:
function coupon_rs($c_data=array())
      And change it to this:
PHP Code:
function coupon($c_data=array()){
    
$awo_file = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_awocouponrs'.DS.'helpers'.DS.'rs_coupon.php';
    if(
file_exists($awo_file)) {
        require_once
$awo_file;
        return
rs_coupon::process_coupon_code($c_data);
    }
    return
$this->coupon_rs($c_data);
}
function
coupon_rs($c_data=array())
Using the software - Administration
Now that we have finished installing the application, we can look closely at the features presented in AwoCoupon.
Getting Around
Log into the administration screen and go to Components » AwoCoupon. Here you will see the control panel. It shows the general statistics of what coupons you currently have configured as well as a couple of menus. From here you can enter a new coupon or view the entries of coupons you have.
Configuring a Coupon
To add a new coupon, select "New Coupon" from the control panel, or from the coupons list "New".
Fields:
Coupon Code enter a unique coupon code of up to 32 characters
Published Options
    Published: active coupon
    Unpublished: inactive coupon
Function Type Options
    Coupon: used as a normal coupon.
    Gift Certificate: used as a gift certificate. *** available in the PRO version Only ***
Number of uses
    Options
        Total: treats the number of uses as a total across all users
        per Customer: treats the number of uses as per user
    Number: if both the dropdown and textfield are left blank, there is no limit.
Percent or Total Options
    Percent: coupon takes a percent of value
    Total: coupon is an actual figure that is subtracted from total
Discount Type Options
This option can only be used if a product is selected AND the Percent or Total field is selected as a Percent. Otherwise it defaults to "Overall".
    Overall: The discount is calculated as a percentage of the overall total in the shopping cart
    Specific: The discount is calculated as a percentage of the total of the products configured in the coupon that are in the shopping cart
Value Number: this is the value of the coupon and is dependent on the Percent or Total field to determine how it is calculated
Minimum Value Number: this is the minimum value of the shopping cart before this coupon can take effect. If set to 0 or is left blank, then there is no minimum value
Expiration Date: the date the coupon expires. If left blank, then it never expires.
Customers A multiple select box of all your redSHOP customers. Selection of customers will activate the coupon only for those customers.
Products A multiple select box of all your redSHOP products. Selection of products will limit the activation of the coupon to those specific products.
Example Usage
The customer and product field are multiple selection boxes. So you can select none, one, or multiple customers and/or products for every coupon configured.
Example 1
Coupon Code: COUPONCODE
Published: Published
Function Type: Coupon
Number of Uses: 1
Percent or Total: Percent
Discount Type: Overall
Value: 25
Minimum Value: blank
Expiration: blank
Customer: None chosen
Products: None chosen
This coupon will work for all products and all customers (including any new registrations) for exactly 1 time per customer. It will take 25% off the total value of the shopping cart. The coupon never expires. The customer is required to have an account to be able to use this code.
Example 2
Coupon Code: COUPONCODE
Published: Published
Function Type: Coupon
Number of Uses: blank
Percent or Total: Value
Discount Type: Overall
Value: 25
Minimum Value: 100
Expiration: 2020-10-17
Customer: 2 chosen
Products: 3 chosen
This coupon will work for the 2 customers chosen as long as their shopping cart total has a minimum total of 100 and at least one product in the cart is one of the 3 chosen in the coupon. It is a permanent coupon so it will work everytime used as long as the criteria are met. The coupon will become invalid on October 17, 2020.
Example 3
Coupon Code: COUPONCODE
Published: Published
Function Type: Coupon
Number of Uses: 3
Percent or Total: Percent
Discount Type: Specific
Value: 20
Minimum Value: 120
Expiration: blank
Customer: 7 chosen
Products: 3 chosen
This coupon will work for the 7 customers chosen as long as their shopping cart has a minimum total of 120 and at least one product in the cart is one of the 3 chosen in the coupon. Since the discount type is set to specific, 20% will only be deducted from the value of the product set in the coupon. If the customer has all 3 products, 20% will be deducted from all 3 products. Each of the customers selected can use this coupon a total of 3 times. Since it has no expiration date, it never expires, but with the restrictions set, it effectively expires after all 7 customers use the coupon on 3 seperate occasions each.
Example 4
Coupon Code: COUPONCODE
Published: Published
Function Type: Gift Certificate
Number of Uses: 1
Percent or Total: Total
Discount Type: Overall
Value: 5
Minimum Value: blank
Expiration: blank
Customer: blank
Products: blank
This coupon will work exactly like a gift certificate. Anybody can use it (an account is not required) and it will work for exactly 1 time. Once used, it becomes invalid.
Troubleshooting
Please post specific questions in the forum.