GetDBField('PackageContent'), '|'); if ($ids_string) { $ids_array = explode('|', $ids_string); return $ids_array; } else { return array(); } } /** * Returns price from primary pricing for product * * @return float */ function getPrimaryPrice() { if (!$this->Application->IsAdmin()) { $user_id = $this->Application->RecallVar('user_id'); $primary_group = $user_id != -2 ? $this->Conn->GetOne('SELECT GroupId FROM '.TABLE_PREFIX.'UserGroup WHERE PrimaryGroup = 1 AND PortalUserId = '.$user_id) : false; if ($primary_group) { $sql = 'SELECT Price FROM '.TABLE_PREFIX.'ProductsPricing WHERE (ProductId = '.$this->GetID().') AND (GroupId = '.$primary_group.') ORDER BY MinQty'; $price = $this->Conn->GetOne($sql); if ($price !== false) { return floatval( $price ); } } } $pr_table = $this->Application->getUnitOption('pr', 'TableName'); if ($this->mode == 't') { $pr_table = $this->Application->GetTempName($pr_table, 'prefix:'.$this->Prefix); } $sql = 'SELECT Price FROM '.$pr_table.' WHERE ('.$this->IDField.' = '.$this->GetID().') AND (IsPrimary = 1)'; return floatval( $this->Conn->GetOne($sql) ); } } ?>