SQL_FREERESULT($result);
// Fix empty subject line
- if (empty($content['subject'])) $content['subject'] = '{--DEFAULT_SUBJECT_LINE--}';
+ if (empty($content['subject'])) {
+ $content['subject'] = '{--DEFAULT_SUBJECT_LINE--}';
+ } // END - if
// Calculate used points
- $usedPoints = $content['target_send'] * getPaymentPoints($content['payment_id']);
+ $content['payed_points'] = $content['target_send'] * getPaymentPoints($content['payment_id']);
+ subtractPoints('order', getMemberId(), $content['payed_points']);
// Update used points
$add = '';
- if (getConfig('order_max_full') == 'ORDER') $add = ', `mail_orders`=`mail_orders`+1';
- subtractPoints('order', getMemberId(), $usedPoints);
+ if ((isExtensionInstalledAndNewer('order', '0.1.1')) && (getConfig('order_max_full') == 'ORDER')) {
+ $add = ', `mail_orders`=`mail_orders`+1';
+ } // END - if
// Send an email to the user
$message_mem = loadEmailTemplate('member_order_normal', $content, getMemberId());