/*************************************************\
| Customer Reward Points 1.1.0 |
| |
|Reward your repeat customers!! |
| Fully featured, highly customizable customer |
| points rewards system. |
| -Each product can have it's own point value |
| and you can also have a global point value for |
| orders. |
| -Points are auto calculated based on order |
| status |
| -See full feature list on our website |
| |
| BCS Engineering |
| Copyright (c) 2004 BCS Engineering, |
| Carrie L. Saunders
| All rights reserved. |
| See http://www.bcsengineering.com/license.shtml |
| for full license |
| For X-cart versions 3.4.X |
\*************************************************/
NOTE: You should always make a back-up copy of your files and database before installing any modification.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INSTALLATION:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Log into your Admin interface and copy and paste the SQL queries in patch.sql into the Patch/Upgrade sql utility. (You can put them all in at once)
2. Uncompress the zip and copy all the files into their appropriate directories.
3. In include/func.php
Find the function func_calculate_single and insert this code:
# BCSE Points Begin
$total = $total - $cart["points_discount"];
# BCSE Points End
After:
$total = $total-$discount;
$total_shipping -= $discount;
if ($total_shipping < 0)
$total_shipping = 0;
Find the function func_place_order and insert this code:
# BCSE Begin
include "bcse_points_system_order.php";
# BCSE End
After (there is a very long query before this):
$orderid=db_insert_id();
Finally in include/func.php find the function func_change_order_status and insert this code:
# BCSE Begin
include "bcse_points_system_order.php";
# BCSE End
After:
db_query("update $sql_tbl[orders] set status='$status'".(($advinfo)? ", details='".$info."'" : "")." where orderid='$orderid'");
4. Add to skin1/common_templates.tpl:
{* BCSE Begin *}
{elseif $main eq "points_system_rates"}
{include file="admin/main/bcse_points_system.tpl"}
{* BCSE End *}
Somewhere after the first {if}
5. Add to skin1/admin/menu.tpl:
Customer Reward Points
Recommended Before
{/capture}
6. Add to customer/cart.php:
# BCSE Begin
$cart["points_discount"]=0;
$cart["points_used"]=0;
# BCSE Begin
After:
if ($mode=="delete" && $productindex!="") {
#
# Delete product from cart
#
Also Add to cart.php:
# BCSE Begin
if($points['total'] <=0)
$cart['points_discount']=0;
# BCSE End
After:
require "./auth.php";
include $xcart_dir."/shipping/shipping.php";
7. Add to skin1/customer/main/cart_totals.tpl:
{* BCSE Begin *}