Countless fixes, ext-grade started:
[mailer.git] / inc / filter / coupon_filter.php
index cafe31b95ee302a2dc0259658909a68fe902a78b..098c83ec8f68592b670cf31909542c2216a9ff46 100644 (file)
@@ -43,17 +43,8 @@ if (!defined('__SECURITY')) {
 // Filter to change column name for the right "points account"
 function FILTER_COUPON_CHANGE_POINTS_COLUMN_NAME ($data) {
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
-       // Are the points locked?
-       if (($data['locked'] === true) && (getConfig('coupon_locked_points_mode') == 'LOCKED')) {
-               // Locked points may be routed to special account
-               $data['column'] = 'locked_order_points';
-       } elseif (getConfig('coupon_points_account') == 'ORDER') {
-               // These points should be routed to 'order' account
-               $data['column'] = 'order_points';
-       } else {
-               // Else all went to general account
-               $data['column'] = 'points';
-       }
+       // Get the column name from extension's name and 'locked'
+       $data['column'] = getPointsColumnNameFromExtensionNameLocked('coupon', $data['locked']);
 
        // Return data
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');