16 public function __construct( $sObjectsInListName =
'oxattribute')
34 foreach ($aIds as $iKey => $sVal) {
38 $sAttrViewName = getViewName(
'oxattribute' );
39 $sViewName = getViewName(
'oxobject2attribute' );
41 $sSelect =
"select $sAttrViewName.oxid, $sAttrViewName.oxtitle, {$sViewName}.oxvalue, {$sViewName}.oxobjectid ";
42 $sSelect .=
"from {$sViewName} left join $sAttrViewName on $sAttrViewName.oxid = {$sViewName}.oxattrid ";
43 $sSelect .=
"where {$sViewName}.oxobjectid in ( '".implode(
"','", $aIds).
"' ) ";
44 $sSelect .=
"order by {$sViewName}.oxpos, $sAttrViewName.oxpos";
58 $aAttributes = array();
60 if ($rs !=
false && $rs->recordCount() > 0) {
62 if ( !isset( $aAttributes[$rs->fields[0]])) {
63 $aAttributes[$rs->fields[0]] =
new stdClass();
66 $aAttributes[$rs->fields[0]]->title = $rs->fields[1];
67 if ( !isset( $aAttributes[$rs->fields[0]]->aProd[$rs->fields[3]])) {
68 $aAttributes[$rs->fields[0]]->aProd[$rs->fields[3]] =
new stdClass();
70 $aAttributes[$rs->fields[0]]->aProd[$rs->fields[3]]->value = $rs->fields[2];
91 $sAttrViewName = getViewName(
'oxattribute' );
92 $sViewName = getViewName(
'oxobject2attribute' );
94 $sSelect =
"select {$sAttrViewName}.`oxid`, {$sAttrViewName}.`oxtitle`, o2a.`oxvalue` from {$sViewName} as o2a ";
95 $sSelect .=
"left join {$sAttrViewName} on {$sAttrViewName}.oxid = o2a.oxattrid ";
96 $sSelect .=
"where o2a.oxobjectid = '%s' and o2a.oxvalue != '' ";
97 $sSelect .=
"order by o2a.oxpos, {$sAttrViewName}.oxpos";
99 $aAttributes = $oDb->getAll( sprintf( $sSelect, $sArticleId ) );
102 $aParentAttributes = $oDb->getAll( sprintf( $sSelect, $sParentId ));
125 $sAttrViewName = getViewName(
'oxattribute' );
126 $sViewName = getViewName(
'oxobject2attribute' );
128 $sSelect =
"select {$sAttrViewName}.*, o2a.* from {$sViewName} as o2a ";
129 $sSelect .=
"left join {$sAttrViewName} on {$sAttrViewName}.oxid = o2a.oxattrid ";
130 $sSelect .=
"where o2a.oxobjectid = '%s' and {$sAttrViewName}.oxdisplayinbasket = 1 and o2a.oxvalue != '' ";
131 $sSelect .=
"order by o2a.oxpos, {$sAttrViewName}.oxpos";
133 $aAttributes = $oDb->getAll( sprintf( $sSelect, $sArtId ) );
136 $aParentAttributes = $oDb->getAll( sprintf( $sSelect, $sParentId ));
158 $oArtList =
oxNew(
"oxarticlelist");
159 $oArtList->loadCategoryIDs( $sCategoryId, $aSessionFilter );
162 if (
count($oArtList) > 0 ) {
165 foreach (array_keys($oArtList->getArray()) as $sId ) {
169 $sArtIds .= $oDb->quote($sId);
172 $sActCatQuoted = $oDb->quote( $sCategoryId );
173 $sAttTbl = getViewName(
'oxattribute', $iLang );
174 $sO2ATbl = getViewName(
'oxobject2attribute', $iLang );
175 $sC2ATbl = getViewName(
'oxcategory2attribute', $iLang );
177 $sSelect =
"SELECT DISTINCT att.oxid, att.oxtitle, o2a.oxvalue ".
178 "FROM $sAttTbl as att, $sO2ATbl as o2a ,$sC2ATbl as c2a ".
179 "WHERE att.oxid = o2a.oxattrid AND c2a.oxobjectid = $sActCatQuoted AND c2a.oxattrid = att.oxid AND o2a.oxvalue !='' AND o2a.oxobjectid IN ($sArtIds) ".
180 "ORDER BY c2a.oxsort , att.oxpos, att.oxtitle, o2a.oxvalue";
182 $rs = $oDb->select( $sSelect );
184 if ( $rs !=
false && $rs->recordCount() > 0 ) {
185 while ( !$rs->EOF && list( $sAttId, $sAttTitle, $sAttValue ) = $rs->fields ) {
189 $oAttribute =
oxNew(
"oxattribute" );
190 $oAttribute->setTitle( $sAttTitle );
192 $this->
offsetSet( $sAttId, $oAttribute );
194 if ( isset( $aSessionFilter[$sCategoryId][$iLang][$sAttId] ) ) {
195 $oAttribute->setActiveValue( $aSessionFilter[$sCategoryId][$iLang][$sAttId] );
199 $oAttribute = $this->
offsetGet( $sAttId );
202 $oAttribute->addValue( $sAttValue );
222 if (
count( $aParentAttributes ) ) {
224 foreach ( $aAttributes as $aAttribute ) {
225 $aAttrIds[] = $aAttribute[
'OXID'];
228 foreach ( $aParentAttributes as $aAttribute ) {
229 if ( !in_array( $aAttribute[
'OXID'], $aAttrIds ) ) {
230 $aAttributes[] = $aAttribute;