Community Add-Ons
| Maintainers: | boxtel |
Easy Discount
for osCommerce Online Merchant v2.2
Easy discount:
Apply multiple checkout discount at any time, anywhere for whatever reason.
fixed order editor compatibility
This modifies the easy discount code so it follows the oSC naming policy of creating the file as {name}.php & the configuration_key as MODULE_ORDER_TOTAL_{name}_SORT_ORDER. I did this specifically to be compatible with ot_sort_order Folder contrib, but may be needed for other contribs.
***IMPORTANT***
DISABLE YOUR CURRENT EASY DISCOUNT MODULE BEFORE INSTALLING THIS UPDATE
1. catalog:includes:languages:english:modules:order_total:ot_easy_discount.php:
CHANGE:
define('MODULE_EASY_DISCOUNT_TITLE', 'Easy Discount');
define('MODULE_EASY_DISCOUNT_DESCRIPTION', 'Easy discount.');
TO:
define('MODULE_ORDER_TOTAL_EASY_DISCOUNT_TITLE', 'Easy Discount');
define('MODULE_ORDER_TOTAL_EASY_DISCOUNT_DESCRIPTION', 'Easy discount.');
2. catalog:includes:modules:order_total:ot_easy_discount.php:
CHANGE:
function ot_easy_discount() {
$this->code = 'ot_easy_discount';
$this->title = MODULE_EASY_DISCOUNT_TITLE;
$this->description = MODULE_EASY_DISCOUNT_DESCRIPTION;
$this->enabled = ((MODULE_EASY_DISCOUNT_STATUS == 'true') ? true : false);
$this->sort_order = MODULE_EASY_DISCOUNT_SORT_ORDER;
$this->output = array();
}
TO:
function ot_easy_discount() {
$this->code = 'ot_easy_discount';
$this->title = MODULE_ORDER_TOTAL_EASY_DISCOUNT_TITLE;
$this->description = MODULE_ORDER_TOTAL_EASY_DISCOUNT_DESCRIPTION;
$this->enabled = ((MODULE_ORDER_TOTAL_EASY_DISCOUNT_STATUS == 'true') ? true : false);
$this->sort_order = MODULE_ORDER_TOTAL_EASY_DISCOUNT_SORT_ORDER;
$this->output = array();
}
3. catalog:includes:modules:order_total:ot_easy_discount.php:
CHANGE:
$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_EASY_DISCOUNT_STATUS'");
TO:
$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_EASY_DISCOUNT_STATUS'");
4. catalog:includes:modules:order_total:ot_easy_discount.php:
CHANGE:
return array('MODULE_EASY_DISCOUNT_STATUS', 'MODULE_EASY_DISCOUNT_SORT_ORDER');
TO:
return array('MODULE_ORDER_TOTAL_EASY_DISCOUNT_STATUS', 'MODULE_ORDER_TOTAL_EASY_DISCOUNT_SORT_ORDER');
5. catalog:includes:modules:order_total:ot_easy_discount.php:
CHANGE:
('Activate Easy Discount', 'MODULE_EASY_DISCOUNT_STATUS', 'true', 'Do you want to enable the Easy discount module?', '6', '1','tep_cfg_select_option(array('true', 'false'), ', now())");
TO:
('Activate Easy Discount', 'MODULE_ORDER_TOTAL_EASY_DISCOUNT_STATUS', 'true', 'Do you want to enable the Easy discount module?', '6', '1','tep_cfg_select_option(array('true', 'false'), ', now())");
6. catalog:includes:modules:order_total:ot_easy_discount.php:
CHANGE:
('Sort Order', 'MODULE_EASY_DISCOUNT_SORT_ORDER', '2', 'Sort order of display.', '6', '2', now())");
TO:
('Sort Order', 'MODULE_ORDER_TOTAL_EASY_DISCOUNT_SORT_ORDER', '2', 'Sort order of display.', '6', '2', now())");
NOT A COMPLETE PACKAGE
Easy discount:
Apply multiple checkout discount at any time, anywhere for whatever reason.
Notes for upgraders:
discounts are now named to prevent multiple discounts from loops
method for add is renamed to set
method for remove_type is renamed to clear
the total determination is now in the class iso the functions
display easy discounts in the shopping cart infobox
Easy Discount in shopping cart addon
Easy discount:
Apply multiple checkout discount at any time, anywhere for whatever reason.
