public static function catchCatalogOrderPayment($orderId, $value) { if (!static::isOn()) { return; } if ($value == 'Y') { $data = static::getOrderInfo($orderId); $data['paid'] = '1'; $data['bx_user_id'] = static::getBxUserId(); $data['domain'] = Context::getCurrent()->getServer()->getHttpHost(); $data['date'] = date(DATE_ISO8601); CounterDataTable::add(array('TYPE' => 'order_pay', 'DATA' => $data)); } }
public static function catchCatalogOrderPayment($orderId, $value) { if (!static::isOn()) { return; } if ($value == 'Y') { $data = static::getOrderInfo($orderId); // catalog items only if (empty($data['products'])) { return; } // add bxuid $data['bx_user_id'] = static::getBxUserId(); if (empty($data['bx_user_id']) && OrderTable::getEntity()->hasField('BX_USER_ID')) { $order = OrderTable::getRow(array('select' => array('BX_USER_ID'), 'filter' => array('=ID' => $orderId))); if (!empty($order) && !empty($order['BX_USER_ID'])) { $data['bx_user_id'] = $order['BX_USER_ID']; } } // add general info $data['paid'] = '1'; $data['domain'] = Context::getCurrent()->getServer()->getHttpHost(); $data['date'] = date(DATE_ISO8601); CounterDataTable::add(array('TYPE' => 'order_pay', 'DATA' => $data)); } }