31 foreach ($aIds as $iKey => $sVal) {
35 $sAttrViewName = getViewName(
'oxattribute');
36 $sViewName = getViewName(
'oxobject2attribute');
38 $sSelect =
"select $sAttrViewName.oxid, $sAttrViewName.oxtitle, {$sViewName}.oxvalue, {$sViewName}.oxobjectid ";
39 $sSelect .=
"from {$sViewName} left join $sAttrViewName on $sAttrViewName.oxid = {$sViewName}.oxattrid ";
40 $sSelect .=
"where {$sViewName}.oxobjectid in ( '" . implode(
"','", $aIds) .
"' ) ";
41 $sSelect .=
"order by {$sViewName}.oxpos, $sAttrViewName.oxpos";
55 $aAttributes = array();
57 if ($rs !=
false && $rs->recordCount() > 0) {
59 if (!isset($aAttributes[$rs->fields[0]])) {
60 $aAttributes[$rs->fields[0]] =
new stdClass();
63 $aAttributes[$rs->fields[0]]->title = $rs->fields[1];
64 if (!isset($aAttributes[$rs->fields[0]]->aProd[$rs->fields[3]])) {
65 $aAttributes[$rs->fields[0]]->aProd[$rs->fields[3]] =
new stdClass();
67 $aAttributes[$rs->fields[0]]->aProd[$rs->fields[3]]->value = $rs->fields[2];
87 $sAttrViewName = getViewName(
'oxattribute');
88 $sViewName = getViewName(
'oxobject2attribute');
90 $sSelect =
"select {$sAttrViewName}.`oxid`, {$sAttrViewName}.`oxtitle`, o2a.`oxvalue` from {$sViewName} as o2a ";
91 $sSelect .=
"left join {$sAttrViewName} on {$sAttrViewName}.oxid = o2a.oxattrid ";
92 $sSelect .=
"where o2a.oxobjectid = '%s' and o2a.oxvalue != '' ";
93 $sSelect .=
"order by o2a.oxpos, {$sAttrViewName}.oxpos";
95 $aAttributes = $oDb->getAll(sprintf($sSelect, $sArticleId));
98 $aParentAttributes = $oDb->getAll(sprintf($sSelect, $sParentId));
119 $sAttrViewName = getViewName(
'oxattribute');
120 $sViewName = getViewName(
'oxobject2attribute');
122 $sSelect =
"select {$sAttrViewName}.*, o2a.* from {$sViewName} as o2a ";
123 $sSelect .=
"left join {$sAttrViewName} on {$sAttrViewName}.oxid = o2a.oxattrid ";
124 $sSelect .=
"where o2a.oxobjectid = '%s' and {$sAttrViewName}.oxdisplayinbasket = 1 and o2a.oxvalue != '' ";
125 $sSelect .=
"order by o2a.oxpos, {$sAttrViewName}.oxpos";
127 $aAttributes = $oDb->getAll(sprintf($sSelect, $sArtId));
130 $aParentAttributes = $oDb->getAll(sprintf($sSelect, $sParentId));
152 $oArtList =
oxNew(
"oxarticlelist");
153 $oArtList->loadCategoryIDs($sCategoryId, $aSessionFilter);
156 if (
count($oArtList) > 0) {
159 foreach (array_keys($oArtList->getArray()) as $sId) {
163 $sArtIds .= $oDb->quote($sId);
166 $sActCatQuoted = $oDb->quote($sCategoryId);
167 $sAttTbl = getViewName(
'oxattribute', $iLang);
168 $sO2ATbl = getViewName(
'oxobject2attribute', $iLang);
169 $sC2ATbl = getViewName(
'oxcategory2attribute', $iLang);
171 $sSelect =
"SELECT DISTINCT att.oxid, att.oxtitle, o2a.oxvalue " .
172 "FROM $sAttTbl as att, $sO2ATbl as o2a ,$sC2ATbl as c2a " .
173 "WHERE att.oxid = o2a.oxattrid AND c2a.oxobjectid = $sActCatQuoted AND c2a.oxattrid = att.oxid AND o2a.oxvalue !='' AND o2a.oxobjectid IN ($sArtIds) " .
174 "ORDER BY c2a.oxsort , att.oxpos, att.oxtitle, o2a.oxvalue";
176 $rs = $oDb->select($sSelect);
178 if ($rs !=
false && $rs->recordCount() > 0) {
179 while (!$rs->EOF && list($sAttId, $sAttTitle, $sAttValue) = $rs->fields) {
183 $oAttribute =
oxNew(
"oxattribute");
184 $oAttribute->setTitle($sAttTitle);
188 if (isset($aSessionFilter[$sCategoryId][$iLang][$sAttId])) {
189 $oAttribute->setActiveValue($aSessionFilter[$sCategoryId][$iLang][$sAttId]);
196 $oAttribute->addValue($sAttValue);
216 if (
count($aParentAttributes)) {
218 foreach ($aAttributes as $aAttribute) {
219 $aAttrIds[] = $aAttribute[
'OXID'];
222 foreach ($aParentAttributes as $aAttribute) {
223 if (!in_array($aAttribute[
'OXID'], $aAttrIds)) {
224 $aAttributes[] = $aAttribute;