Community Add-Ons
| Maintainers: | kgt |
Discount Coupon Codes
for osCommerce Online Merchant v2.2
Create coupon codes for your customers to use for discounts on orders.
Discounts are applied before tax and are displayed as one order total line for each applicable tax class. You can configure whether to display the order subtotal including the discount, or before the discount is applied.
Coupon codes may be configured with a start or ending date, number of times they may be used, and an order minimum.
English___________
Added Spanish's translations in catalog and admin.
Español__________
Añadidas traducciones al Español en el catálogo y admin.
FULL PACKAGE
The price calculation is different in newer versions OsCommerce.
This was very helpfull for me as I couldn't find the solution in the forum.
Not complete file, just calculation section included.
Credit goes to Author.
This version is based off of 21 Mar 2009 by rajonbh.
Includes a fix for a problem with exclusions in shipping's discounts, spanish manual and problem with min order min order type: price total.
This is a full package
The content of the dc_autoinstaller/index.php file was moved to control.php to make the php version check work.
Autoinstaller 2.14 for Discount Coupon Codes 3.32 by dynamoeffects (30 Jan 2009)
The Auto Installer script requires PHP 5.2.0
After installation instructions were added for PayPal IPN
Autoinstaller 2.14 for Discount Coupon Codes 3.32 by dynamoeffects (30 Jan 2009)
The Auto Installer script requires PHP 5.2.0 !
The "Edit Manually" button fixed
Autoinstaller 2.14 for Discount Coupon Codes 3.32 by dynamoeffects (30 Jan 2009)
The Auto Installer script requires PHP 5.2.0 !
Few lines of code were added to list all the files that should have 777 permissions.
Autoinstaller 2.13 for Discount Coupon Codes 3.32 by dynamoeffects (30 Jan 2009)
The Auto Installer script requires PHP5 !
Autoinstaller 2.7 for Discount Coupon Codes 3.32 by dynamoeffects (30 Jan 2009)
The script automatically install the contribution: copy files, edit files, alter database tables.
It saves a backup before any action.
The aim of the script is to speed up the contribution installation.
And to make possible to uninstall it.
You will need to do manually only what the script cannot.
The Auto Installer script requires PHP5 !
problem with Min Order Min Order Type: Price Total
if you use: DISPLAY_PRICE_WITH_TAX == true
Example:
- if you have in shopping cart one item: that has a price without tax: 10$ and a tax 50% that is added to the initial price and the min order is 13 it won't let use the discount coupon because it compare the initial price of the product with the min order
catalog/includes/classes/discount_coupon.php
to add the tax to the product search for function:
function total_valid_products( $products = array() )
there u will find this line:
$price = ( $products[$i]['price'] + $cart->attributes_price( $products[$i]['id'] ) ) * $products[$i]['quantity'];
replace with
if (DISPLAY_PRICE_WITH_TAX == "true"){
$product_tax = tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']);
$price = ( tep_add_tax($products[$i]['price'], $product_tax) + $cart->attributes_price( $products[$i]['id'] ) ) * $products[$i]['quantity'];
}else{
$price = ( $products[$i]['price'] + $cart->attributes_price( $products[$i]['id'] ) ) * $products[$i]['quantity'];
}
That's all. Thanks to this great contribution. All credit to kgt .
The file attached contains only the explanation.
Se ha traducido al español el manual de uso en HTML
No es una traduccion literal como hacen muchos, que usan un traductor y apañatelas como puedas, se le ha dado coherencia a la traducicion y ahora tiene sentido todas las frases
Solo hay que sustituir el que esta en admin/includes/languages/espanol por este
NO es el paquete completo, solo el archivo HTML
************************************
NO is the complete package, just the HTML file
Spanish ONLY
The following fix corrects the javascript error when editing Discount Coupons. The javascript function affected is the SetFocus() function used to set focus on the first form field when the page is loaded.
in admin/includes/general.js
around line 11 find:
(field.elements[i].type != "submit") ) {
replace with:
(field.elements[i].type != "submit") &&
(field.elements[i].disabled != true) ) {
This will ignore disabled fields. The error is caused by trying to set focus on the first form field which is disabled.
Bonjour,
Voila ma première contribution
Bonsoir les Oso c'est Djemai :roll:
Je passe la contribution:
faite attention j'ai suis pas super Man verifier avant la mise en place "Faite des teste en Local!"
All fixes below is included.
This also includes a fix for the problem with subtotals showing with the discount applied, even though "Display subtotal with applied discount?" is set to false.
For this solution only please check http://forums.oscommerce.com/index.php?showtopic=213019&st=2320&gopid=1382552&#entry1382552
admin/includes/boxes/catalog.php & reports.php have little error.
Updated now.
Hi,
this is the bug fix for anybody who want to use the free shipping module AND the discount coupon.
NOT the full package, instructions included!
Greetings!
define('BOX_CONFIGURATION_ADMINISTRATORS','Administrator');
in the dynamoeffects files this error is exist which is fix in this file. If any user who is getting this error in the osc bank end then overwrite the attach include of admin
Regards
Saju
dynamoeffects -> here is the installer db attach which dynamoeffects does not have.
The file which we all use and dynamoeffects is used and belongs to the another author, we only modify and helping the users in order to get the things done.
Once you install this discount coupon mod you will automatically find the read me. The read me you can also get from the forum it self.
Here is the database installer, which is missing in the dynamoeffects files.
For any support contact http://www.wontonetech.com
Wonton for some reason decided to delete the manual and readme along with some copyrights and replace them with his own contact information. Please refrain from doing that as it only degrades the quality of the contribution.
This version is based off of 27 September 2007 by dimi and is the latest version you should use. This version includes some important changes to avoid SQL injection attacks. All readmes and manuals are included.
This is the latest fixation, and zone filter is also enable with this script. Previously a small mistake was in the database and one php file which is now solve.
For any support please contact
http://www.wontonetech.com
This file is the same discount coupon 3.2 but some few fix has been done and for those user who are facing issues in relate to tables, we also have included the tables for that.
if you can have any issues contact http://www.wontonetech.com
Languages included are:
English, French, German, Espanol, Italian.
Just paste into your languages directory.
Or modify on your own.
Enjoy!
Small update incorporates 3.31 bug fix.
Whilst the Discount Coupon Codes add-on allows you to specify table names in the
database_tables.php fies, the install function for the order total module
ignores these and uses the default names. This archive contains a modified
version of the ot_discount_coupon.php file from Discount Coupon Codes 3.3 that
corrects this oversight.
--
Safalra (Stephen Morley)
in catalog/admin/includes/filenames.php, the following line needs to be added at around line 14 : define('FILENAME_ADMINISTRATORS', 'administrators.php');
After installing this contribution some tables are missing for the sql database, meaning when you try to insert a new coupon you recive an sql error similar to this:
1136 - Column count doesn't match value count at row 1
insert into discount_coupons values ( 'myspace', 'MySpace Friend 20% off', '.20', 'percent', null, "2008-06-08", 0, 0, null, 100)
Fix:
Using the SQL below you should be able to remove your existing table (which will remove any coupons already created) and create the table with the appropriate columns:
drop table if exists discount_coupons;
create table discount_coupons (
coupons_id varchar(32) not null ,
coupons_description varchar(64) not null ,
coupons_discount_amount decimal(15,12) default '0.000000000000' not null ,
coupons_discount_type enum('fixed','percent','shipping') default 'percent' not null ,
coupons_date_start datetime ,
coupons_date_end datetime ,
coupons_max_use int(3) default '0' not null ,
coupons_min_order decimal(15,4) default '0.0000' not null ,
coupons_min_order_type enum('price','quantity') default 'price' ,
coupons_number_available int(3) default '0' not null ,
PRIMARY KEY (coupons_id)
);
Missing line of Code in file /public_html/admin/includes/database_tables.php
At or Around Line 16 add:
define('TABLE_ADMINISTRATORS', 'administrators');
When using a fixed amount discount, I wanted to keep the shipping charge.
Currently, if a discount coupon exceeds the order total amount, the order total will be 0.
Example:
$50 Subtotal
$10 Shipping
-$100 Coupon
--------------
$0 Total
Now, you can choose in the Admin section to retain the shipping charge so that the total will not be 0. Discount will only apply to the subtotal, not the order total.
Example:
$50 Subtotal
$10 Shipping
-$100 Coupon
--------------
$10 Total
in catalog/admin/includes/filenames.php, the following line needs to be added at around line 35: define('FILENAME_LOGIN', 'login.php');
I precisely followed all of the installation instructions, twice, and still ran into the same problem.
When everything was updated and I attempted to log into the admin, the menu would not load correctly causing the rest of the admin not to load. It ended up being an issue with the updates required for the files admin/includes/boxes/catalog.php and admin/includes/boxes/reports.php
For admin/includes/boxes/catalog.php the update should should be,
//kgt - discount coupons
'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_DISCOUNT_COUPONS . '</a>' );
/***************
'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>' );
***************/
//end kgt - discount coupons
For admin/includes/boxes/reports.php the update should should be,
//kgt - discount coupons report
'<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_STATS_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_DISCOUNT_COUPONS . '</a>');
/*************
'<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a>');
*************/
//end kgt - discount coupons report
Both instances were missing a period after the first updated piece of code with the link. It caused the rest of the code to not execute.
This is based on kgt's Paypal IPN v 2.2 17 Apr 2007 .
His file didn't work properly with current version of paypal ipn as no ipn was received and order status was not changing.
I used his edited lines on a up to date paypal_ipn.php and that fixed the problem.
All credits to kgt.
This is an optional combo fix which includes my subtotals bug fix (see the bug fix below this one for more info) as well as a fix for table shipping calculations. If you do not use the table shipping method for calculating shipping, you do not need to install this fix. You should instead download and install the fix below this one.
The zip file includes the new discount_coupon.php and table.php files. There are two readme files included - one for users who have already installed the previous fix, and one for users who have not installed either of the fixes.
NOTE: This is a temporary fix for anyone who needs it. It is NOT official, and is only meant to tide users over until KGT or one of the other developers includes such a fix in their official releases. DO NOT message me for support on this bug fix or any other problems you may have with DCC. If you have a problem with this bug fix, simply uninstall it and wait for something more official.
Good luck,
Agra
NOTE: This is a temporary fix for anyone who needs it. It is NOT official, and is only meant to tide users over until KGT or one of the other developers includes such a fix in their official releases. DO NOT message me for support on this bug fix or any other problem you may have with DCC. If you have a problem with this bug fix, simply uninstall it and wait for something more official.
---------------------------
About this bug fix:
---------------------------
This fix is for 3.31 of DCC and includes only the discount_coupon.php file. It is for anyone who is having problems with the discount being applied to subtotals even if the option is chosen to display subtotals without the discount applied. Additionally, this was causing the discount to be applied twice when FALSE was chosen.
I cannot gaurantee the effects of this fix on your installation of DCC. It worked for me on my clean installation of DCC, and I am offering it to the community in hopes that others will find it helpful. There is a readme file included which includes more information and explains how to install this fix manually.
Cheers,
Agra
Small update incorporates 3.3 bug fix and installation instruction update to include installing the image button for shipping zone exclusions.
This is a full package. Upgrade instructions assume version 3.2 is installed.
At the code was missing two (.) :
1) At admin/includes/boxes/catalog.php has to be
//kgt - discount coupons
'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>'.
'<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_DISCOUNT_COUPONS . '</a>' );
/***************
'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>' );
***************/
//end kgt - discount coupons
and
2) At admin/includes/boxes/reports.php has to be
//kgt - discount coupons report
'<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a><br>'.
'<a href="' . tep_href_link(FILENAME_STATS_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_DISCOUNT_COUPONS . '</a>');
/*************
'<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a>'); *************/
//end kgt - discount coupons report
Full Add On with changed install directions to edit catalog/create_account.php
Without the changes to create_account.php, a new customer who sets up their account during checkout will not be allowed to use a coupon code during that same checkout session as the customer_group_id is not being passed.
Bug Fixes:
* Fixed bug that caused subtotal to be incorrect when products with more than 1 quantity are in cart.
This is a full package. Upgrade instructions assume version 3.2 is installed.
Other Changes:
Added the ability to toggle how tax is displayed with the discount line. This will affect mainly store owners who display prices with tax.
This is a full package. Upgrade instructions assume version 3.1 is installed.
Bug Fixes:
Fixed incorrect fixed discount calculation in includes/classes/discount_coupon.php. The bug (and this fix) should affect only stores displaying prices with tax.
Fixed bug that did not associate orders with coupons, so the report did not tally coupon usage, and customers could reuse coupons.
Other Changes:
Added a feature to check against table shipping rates to ensure the shipping fee didn't change as a result of a lower order total after the discount is applied.
This is a complete package. The upgrade instructions assume you have Discount Coupon Codes 3.0 (24 Apr 2007) with Discount Coupon Codes 3.0 checkout_process bugfix (26 Apr 2007) and Discount Coupon Codes 3.0 discount_coupon class bugfix (2 May 2007) installed. The full instructions include those bugfixes.
After having a sale and realizing we just lost money on a purchase (product came to below wholesale cost) I devised a little snip of code to exclude any items on sale from being processed through the sale. But regular items will still receive discount.
You can use the code below or just replace the discount_coupon.php with the one in the zip file. Which ever is easier for you.
Good Luck!
------------------------------------------------
///// In the classes/discount_coupon.php file
Replace the calc function (last function of the file) with this:
function calculate_discount( $product, $product_count ) {
//Start [Central50] sale exclusion
//check if this product ($product['id'] on sale
$specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . $product['id'] . "' and status = '1'");
if (tep_db_num_rows($specials_query) > 0) {
$specials = tep_db_fetch_array($specials_query);
$specialprice = $specials['specials_new_products_price'];
}
// End [Central50] sale exclusion
//if there's a maximum order amount to apply the discount to, determine the percentage of this product's final price we should apply the discount to
$max_applied_percentage = ( $this->coupon['coupons_max_order'] == 0 ? '1.00' : $this->coupon['coupons_max_order'] / ( tep_add_tax( $product['final_price'] * $product['qty'], $product['tax'] ) * $product_count ) );
//Start [Central50] sale exclusion
if ($specialprice > 0) {
//This item is on sale, do not apply ANY discount
$applied_discount = 0;
} else {
//This item is of regular value, let the system proceed with applied discount
$applied_discount = tep_add_tax( $product['final_price'] * $max_applied_percentage * $this->coupon['coupons_discount_percent'], $product['tax'] ) * $product['qty'];
}
//End [Central50] sale exclusion
//don't allow the discount amount to be more than the product price
if( $applied_discount > ( tep_add_tax( $product['final_price'], $product['tax'] ) * $product['qty'] ) ) $applied_discount = tep_add_tax( $product['final_price'], $product['tax'] ) * $product['qty'];
return $applied_discount;
}
-------------------------------------
What I have done is used the code the check for specials from the shopping_cart class file. What I originally did was checked if any item was on sale and just shut off the coupons, but thats not fair to the customer if they have other items that are of regular price.
This will be included in the for loop in the classes/order.php file and if that product is on sale, will not apply the sale to it. If it is not on sale, it will act of regular function.
I am still learning in coding, I have done some extensive custom coding to both of my sites but if anyone sees any problems with this or can improve on it, by all means please do.
And my staff and I have checked the outcome and it does work for me as far as I can tell.
USE AT YOUR OWN RISK, NOT RESPONSIBLE FOR ANYTHING.
This is a bugfix update to the discount coupon class. The bug (and this fix) should affect only stores displaying prices with tax. Simply upload the packaged file to catalog/includes/classes/discount_coupon.php.
This should allow stores that use Separate Pricing Per Customer to exclude a Customer Group from using a Coupon. This is an add-on for v3.0. My store is heavily modified, so I am giving a text document with instructions for modifying your code, as well as the SQL file to run on your database and the image for the Admin side. Thanks to Kristen for all her help in creating this!
This is just the corrected install instructions and bugfix for checkout_process.php. This fixes the bug that did not associate orders with coupons, so the report did not tally coupon usage, and customers could reuse coupons.
Bug Fixes:
Reduced possibility of inaccurate discounts due to rounding errors.
Fixed bug that limited discount to item price (should not be done for fixed discounts).
Other Changes:
True fixed discounts added.
Shipping discounts added.
Exclusions based on products, categories, manufacturers, and customers added.
TracyS provided code for an additional exclusion type, shipping zones.
Added new coupon minimum types "product quantity" and "price total" to limit coupon usage depending on cart item quantity or price total, respectively.
Added module configuration option to toggle whether product specials are excluded.
Added module configuration option to toggle whether order totals are allowed to be negative (can happen if you create a fixed discount with a discount amount greater than the minimum order).
Added a module configuration option to toggle whether debugging should be on.
Hi,
After Applying the code to commerce cart i found that % doesn't work and then it was also stupid that you can't edit the coupon as well as discount % has be added in stupid e.g 15 -> .15. So i decided to work on it and fixed some errors
PLEASE BACKUP YOUR STUFF BEFORE YOU TRY THIS PACKAGE
Features Added
+ You can now edit coupon in full using admin
Bugs Fixed
+ % bug fixed, now you can add the 15% as 15 instead of .15
+ bug fixed which was making 100 % discount if you your discount %
+ see everywhere real % information
+ in admin reports has also been displayed real %
+ admin user manual has been updated.
THIS IS A FULL PACKAGE
Paypal IPN 2.2 (http://www.oscommerce.com/community/contributions,2679) modified for Discount Coupon Codes.
Upload to includes/modules/payment/paypal_ipn.php
This is a fix of the PayPal IPN module to get discount coupons working. No install instructions, just the module which needs to be uploaded to includes/modules/payment/paypal_ipn.php.
This is for version 1.4 found here:
http://www.oscommerce.com/community/contributions,2679
These files provide a german translation of discount coupon codes - for the front- and backend.
The tar.gz contains only the language files - not the whole package. you have to install discount coupon codes first.
ToDo: translate the manual.
After installing this contribution, my client clicked on the link to view the online help manual for this contribution from the admin page. He got a 404 error! The link is to coupons_manual.php, but the file is .html. I have changed the extension to .php for this file. This upload contains the full package for v 2.1, including reporting feature added recently.
If you downloaded version 2.1, you do not need to download this separately, as the report is included in that download.
This is the complete install package.
Bug Fixes:
* Replaced tep_db_prepare_input() with tep_db_input() in includes/classes/discount_coupon.php to correctly sanitize string for database query.
* Max_use, min_order, number_available checks did not work with update to 2.0 because of a missing line.
* Error message for max_use would not display because it was not being saved as a object variable.
* Global currencies variable was not declared in function to check min_order so resulted in an error.
* If discount is more than min_order, do not allow applied discount to exceed the products price to prevent negative order totals.
* Unregister the coupon session variable when logging off.
Other changes:
* Added configuration option to select whether to use language files for order total line display or to use the module configuration field. This is needed for shops using multiple languages that wish to display the order total line formatted for each language.
This is the complete install package.
This also includes the admin report for coupon usage.
Small update to get usage checking working. The fixed upgrade instructions and install instructions are included along with the fixed files.
checkout_confirmation.php line 74 after
$this_coupon = new discount_coupon( $HTTP_POST_VARS['coupon'] );
add
$this_coupon->verify_code();
includes/classes/discount_coupon.php line 68-78 replace
function check_coupons_max_use( $code = '' ) {
$check_use_query = tep_db_query($sql = "SELECT COUNT(*) AS cnt
FROM ".TABLE_ORDERS." AS o
INNER JOIN ".TABLE_DISCOUNT_COUPONS_TO_ORDERS." dc2o
ON dc2o.orders_id=o.orders_id
AND o.customers_id = '".$customer_id."'
AND dc2o.coupons_id='".tep_db_prepare_input( $this->code )."'");
$use = tep_db_fetch_array( $check_use_query );
//show error message if coupons_max_use is equal to the number of times this customer has used the code
if( $this->coupon['coupons_max_use'] <= $use['cnt'] ) $error_message[] = sprintf( ENTRY_DISCOUNT_COUPON_USE_ERROR, $use['cnt'], $this->coupon['coupons_max_use'] ); //display the error message for number of times used
}
with
function check_coupons_max_use() {
global $customer_id;
$check_use_query = tep_db_query($sql = "SELECT COUNT(*) AS cnt
FROM ".TABLE_ORDERS." AS o
INNER JOIN ".TABLE_DISCOUNT_COUPONS_TO_ORDERS." dc2o
ON dc2o.orders_id=o.orders_id
AND o.customers_id = '".(int)$customer_id."'
AND dc2o.coupons_id='".tep_db_prepare_input( $this->code )."'");
$use = tep_db_fetch_array( $check_use_query );
//show error message if coupons_max_use is equal to the number of times this customer has used the code
if( $this->coupon['coupons_max_use'] <= $use['cnt'] ) $this->error_message[] = sprintf( ENTRY_DISCOUNT_COUPON_USE_ERROR, $use['cnt'], $this->coupon['coupons_max_use'] ); //display the error message for number of times used
}
Bug Fixes:
* If free shipping is used, do not allow free shipping if discount brings order total below the minimum for free shipping.
Other Changes:
* Added ability to set maximum order amount to apply the discount. This also allows for using either fixed amount discounts or percentage discounts.
* Updated the manual to include information for the Max Order and Number Available fields.
* Updated manual to be HTML page accessible from coupons admin screen.
* Added discount coupons class to clean up some code in checkout_confirmation.php and order.php.
* Added ability to configure how the discount order total line displays in the order confirmation screen, invoices, etc.
* Added configuration option to choose whether discount order total lines for each tax group should be added and displayed as one line.
This is the complete installation package. Also includes upgrade instructions for Discount Coupon Codes 1.4, posted 27 Jun 2006 with Fixed coupons.php, posted 28 Jun 2006.
PLEASE NOTE: Due to the way osCommerce handles order total calculation and the way that Discount Coupon Codes applies a discount to order totals, fixed discounts have the possibility of being off by small fractions. This can possibly result in a fixed discount of $5.00 being displayed in the order total line as $4.99, for example. The frequency of this happening will be very low. The reason has to do with when the Discount Coupon Codes contribution calculates discounts. The calculation happens during the order object creation, when final total values are not yet known, so the discount is applied incrementally. There are pros and cons to this method. Other Discount Coupon modules calculate discounts after the order object has been created and so may handle fixed discounts with a higher degree of accuracy. If the possibility of fractional rounding errors is unacceptable to you or your customers, I recommend trying one of the other discount coupon contributions.
This is a modified version of 1.4. Same exact install directions. This is designed for new installs only because I have not placed any code in here to alter the mysql tables for upgrades. If you wish to use this as an upgrade or replacement, you would need to alter the table 'discount_coupons' in your mysql. Change coupons_discount_percent setup from decimal for varchar(5).
New installs can just follow directions in install file which has been slightly modified.
Just amended the install txt file to read better, including missing define.
Adds a Discount Coupon Codes Usage Report under the Reports menu in the admin section.
This will only work with the latest version (1.4).
When installing this contribution some people found in admin that it threw and error with mismatched columns - manually edit the code as below or use the new file uploaded
This fixes the issue around line 95
[CODE]tep_db_query($sql = "insert into " . TABLE_DISCOUNT_COUPONS . " (
coupons_id,
coupons_description,
coupons_discount_percent,
date_start,
date_end,
max_use,
min_order)[/CODE]
Change to this
[CODE]tep_db_query($sql = "insert into " . TABLE_DISCOUNT_COUPONS . " (
coupons_id,
coupons_description,
coupons_discount_percent,
date_start,
date_end,
max_use,
min_order,
number_available)[/CODE]
Regards
Mark (Crash3903)
Bug Fixes:
* If "Display Subtotal with Applied Discount" is set to true and min order is set, customer may be incorrectly told that the order subtotal is too low.
This happens when the discount is enough to bring the order subtotal below the min order amount.
* Date limit on coupons was non-inclusive. Discounts with ending dates would be expired at 11:59:59 the night before the set end date.
Other Changes:
* Added ability to set global number of discount coupons available.
Full package. Upgrade instructions from version 1.3 included.
This update makes this great contrib work with Access with Level Account.
This is not the full package.
This is a corrected version of the file included in the previous download. The instructions were correct, so if an install was done by copying and pasting per the instructions, then this file is not needed.
This package contains just the fixed version of this file.
Bug Fixes:
* Fix for hardcoded customer id in query that checks for number of times code has been used.
Other changes:
* Changed dates to accept current admin date format, and to always display using current admin date format.
* Added index to orders table on customers_id to make lookup faster when testing against Max Use.
Bug Fixes:
* Fix for empty coupon order variable that required a refresh before coupon could be displayed.
* Fix for empty variables in coupon INSERT statement.
Other changes:
* Added random code generator contributed by Cubez to coupon code admin.
* Added configure for the length of randomly generated codes in the order total module admin.
* Changed coupon code text box to be uneditable when editing a discount coupon.
Português translation by apopular.
This includes the install instructions and language files. Not a full package.
http://forums.oscommerce.com/index.php?showtopic=213019
Bugs Fixed:
* The Max Use field would not stop a code from being used more than max_use times if the Min Order was not set (set to unlimited).
* The coupon session variable was not destroyed after the checkout processing.
* Some orders with no coupon codes were being entered into the discount_coupons_to_orders table.
Other changes:
* Added a "New Coupon" button to replace the "New Product" button.
* Added an index to the discount_coupons_to_orders table.
This is the full package. Upgrade instructions for the previous versions are included.
Full package. This includes a correction in the manual.
There was an error in the install instructions. This is the complete package with the correct instructions included.
Create coupon codes for your customers to use for discounts on orders.
Discounts are applied before tax and are displayed as one order total line for each applicable tax class. You can configure whether to display the order subtotal including the discount, or before the discount is applied.
Coupon codes may be configured with a start or ending date, number of times they may be used, and an order minimum.
