185 if ($sParentId && $this->_oParentProd === null) {
186 $this->_oParentProd =
false;
187 $oProduct =
oxNew(
'oxArticle');
188 if (($oProduct->load($sParentId))) {
190 $this->_oParentProd = $oProduct;
223 if (!$aVarSelParams && !$aSelectListParams) {
227 if ($aVarSelParams) {
228 foreach ($aVarSelParams as $iKey => $sValue) {
229 $aParams[
"varselid[$iKey]"] = $sValue;
233 if ($aSelectListParams) {
234 foreach ($aSelectListParams as $iKey => $sValue) {
235 $aParams[
"sel[$iKey]"] = $sValue;
252 $oProduct->appendLink($sAddParams);
263 if (isset($this->_sViewId)) {
270 return $this->_sViewId = $sViewId;
292 if ($oProduct->oxarticles__oxtemplate->value) {
293 $this->_sThisTemplate = $oProduct->oxarticles__oxtemplate->value;
297 $this->_sThisTemplate =
'custom/' . basename($sTplName);
302 $sPartial = $this->
getConfig()->getRequestParameter(
'renderPartial');
307 return 'page/details/ajax/fullproductinfo.tpl';
310 return 'page/details/ajax/productmain.tpl';
315 $oLocator->setLocatorData($oProduct, $this);
319 $oRss =
oxNew(
'oxRssFeed');
320 $sTitle = $oRss->getRecommListsTitle($oProduct);
321 $sUrl = $oRss->getRecommListsUrl($oProduct);
322 $this->
addRssFeed($sTitle, $sUrl,
'recommlists');
346 if ($this->
getConfig()->getConfigParam(
'bl_perfParseLongDescinSmarty')) {
347 $sMeta = $oProduct->getLongDesc();
349 $sMeta = $oProduct->getLongDescription()->value;
352 $sMeta = $oProduct->oxarticles__oxshortdesc->value;
354 $sMeta = $oProduct->oxarticles__oxtitle->value .
' - ' . $sMeta;
374 $sKeywords = trim($this->
getTitle());
377 foreach ($oCatTree->getPath() as $oCat) {
378 $sKeywords .=
", " . trim($oCat->oxcategories__oxtitle->value);
383 if ($sSearchKeys = trim($oProduct->oxarticles__oxsearchkeys->value)) {
384 $sKeywords .=
", " . $sSearchKeys;
408 $dRating = $this->
getConfig()->getRequestParameter(
'artrating');
409 if ($dRating !== null) {
410 $dRating = (int) $dRating;
414 if ($dRating !== null && $dRating >= 1 && $dRating <= 5) {
415 $oRating =
oxNew(
'oxrating');
416 if ($oRating->allowRating($oUser->getId(),
'oxarticle', $oProduct->getId())) {
417 $oRating->oxratings__oxuserid =
new oxField($oUser->getId());
418 $oRating->oxratings__oxtype =
new oxField(
'oxarticle');
419 $oRating->oxratings__oxobjectid =
new oxField($oProduct->getId());
420 $oRating->oxratings__oxrating =
new oxField($dRating);
422 $oProduct->addToRatingAverage($dRating);
426 if (($sReviewText = trim((
string ) $this->
getConfig()->getRequestParameter(
'rvw_txt',
true)))) {
427 $oReview =
oxNew(
'oxReview');
428 $oReview->oxreviews__oxobjectid =
new oxField($oProduct->getId());
429 $oReview->oxreviews__oxtype =
new oxField(
'oxarticle');
432 $oReview->oxreviews__oxuserid =
new oxField($oUser->getId());
433 $oReview->oxreviews__oxrating =
new oxField(($dRating !== null) ? $dRating : 0);
456 $sRecommText = trim((
string ) $this->
getConfig()->getRequestParameter(
'recomm_txt'));
457 $sRecommList = $this->
getConfig()->getRequestParameter(
'recomm');
461 $oRecomm =
oxNew(
'oxrecommlist');
462 $oRecomm->load($sRecommList);
463 $oRecomm->addArticle($sArtId, $sRecommText);
480 $sTags = $this->
getConfig()->getRequestParameter(
'newTags',
true);
481 $sHighTag = $this->
getConfig()->getRequestParameter(
'highTags',
true);
482 if (!$sTags && !$sHighTag) {
486 $sTags =
getStr()->html_entity_decode($sHighTag);
492 $aAddedTags = $aTaggedProducts ? $aTaggedProducts[$oProduct->getId()] : array();
494 $oArticleTagList =
oxNew(
"oxArticleTagList");
495 $oArticleTagList->load($oProduct->getId());
496 $sSeparator = $oArticleTagList->get()->getSeparator();
497 $aTags = array_unique(explode($sSeparator, $sTags));
499 $aResult = $this->
_addTagsToList($oArticleTagList, $aTags, $aAddedTags);
501 if (!empty($aResult[
'tags'])) {
502 $oArticleTagList->save();
503 foreach ($aResult[
'tags'] as $sTag) {
504 $aAddedTags[$sTag] = 1;
506 $aTaggedProducts[$oProduct->getId()] = $aAddedTags;
510 if ($this->
getConfig()->getRequestParameter(
'blAjax',
true)) {
528 $aResult = array(
'tags' => array(),
'invalid' => array(),
'inlist' => array());
530 foreach ($aTags as $sTag) {
531 $oTag =
oxNew(
"oxtag", $sTag);
532 if ($aAddedTags[$oTag->get()] != 1) {
533 if ($oTag->isValid()) {
534 $oArticleTagList->addTag($oTag);
535 $aResult[
'tags'][] = $oTag->get();
537 $aResult[
'invalid'][] = $oTag->get();
540 $aResult[
'inlist'][] = $oTag->get();
559 $oArticleTagList =
oxNew(
"oxArticleTagList");
560 $oArticleTagList->load($this->
getProduct()->getId());
561 $oTagSet = $oArticleTagList->get();
562 $this->_aTags = $oTagSet->get();
563 $this->_blEditTags =
true;
566 if ($this->
getConfig()->getRequestParameter(
'blAjax',
true)) {
569 $oActView =
oxNew(
'oxubase');
571 $oSmarty->assign(
'oView', $this);
574 $oSmarty->fetch(
'page/details/inc/editTags.tpl', $this->getViewId())
586 $oArticleTagList =
oxNew(
"oxArticleTagList");
587 $oArticleTagList->load($this->
getProduct()->getId());
588 $oTagSet = $oArticleTagList->get();
589 $this->_aTags = $oTagSet->get();
590 $this->_blEditTags =
false;
596 $oActView =
oxNew(
'oxubase');
598 $oSmarty->assign(
'oView', $this);
601 $oSmarty->fetch(
'page/details/inc/tags.tpl', $this->getViewId())
614 return $oProduct->getId();
652 if ($this->_oProduct === null) {
656 $oConfig->setConfigParam(
'blLoadVariants',
true);
658 $sOxid = $this->
getConfig()->getRequestParameter(
'anid');
661 $this->_oProduct =
oxNew(
'oxarticle');
663 if (!$this->_oProduct->load($sOxid)) {
664 $oUtils->redirect($oConfig->getShopHomeURL());
665 $oUtils->showMessageAndExit(
'');
668 $sVarSelIdParameter = $this->
getConfig()->getRequestParameter(
"varselid");
669 $aVariantSelections = $this->_oProduct->getVariantSelections($sVarSelIdParameter);
670 if ($aVariantSelections && $aVariantSelections[
'oActiveVariant'] && $aVariantSelections[
'blPerfectFit']) {
671 $this->_oProduct = $aVariantSelections[
'oActiveVariant'];
676 if (!$this->_blIsInitialized) {
692 if (!$this->_oProduct->isVisible()) {
694 } elseif ($this->_oProduct->oxarticles__oxparentid->value) {
695 $oParent = $this->
_getParentProduct($this->_oProduct->oxarticles__oxparentid->value);
696 if (!$oParent || !$oParent->isVisible()) {
702 $oUtils->redirect($oConfig->getShopHomeURL());
703 $oUtils->showMessageAndExit(
'');
707 $this->_blIsInitialized =
true;
717 if ($this->_iLinkType === null) {
718 $sListType = $this->
getConfig()->getRequestParameter(
'listtype');
719 if (
'vendor' == $sListType) {
721 } elseif (
'manufacturer' == $sListType) {
724 } elseif (
'tag' == $sListType) {
728 } elseif (
'recommlist' == $sListType) {
763 if ($this->_sParentName === null) {
764 $this->_sParentName =
false;
766 $this->_sParentName = $oParent->oxarticles__oxtitle->value;
782 if ($this->_sParentUrl === null) {
783 $this->_sParentUrl =
false;
785 $this->_sParentUrl = $oParent->getLink();
799 if ($this->_aPicGallery === null) {
816 return $aPicGallery[
'ActPicID'];
828 return $aPicGallery[
'ActPic'];
840 return $aPicGallery[
'Pics'];
854 return $aPicGallery[
'Pics'][$sPicNr];
864 if ($this->_aSelectLists === null) {
865 $this->_aSelectLists =
false;
866 if ($this->
getConfig()->getConfigParam(
'bl_perfLoadSelectLists')) {
867 $this->_aSelectLists = $this->
getProduct()->getSelectLists();
881 if ($this->_aReviews === null) {
882 $this->_aReviews =
false;
883 if ($this->
getConfig()->getConfigParam(
'bl_perfLoadReviews')) {
884 $this->_aReviews = $this->
getProduct()->getReviews();
898 if ($this->_oCrossSelling === null) {
899 $this->_oCrossSelling =
false;
901 $this->_oCrossSelling = $oProduct->getCrossSelling();
915 if ($this->_oSimilarProducts === null) {
916 $this->_oSimilarProducts =
false;
918 $this->_oSimilarProducts = $oProduct->getSimilarProducts();
934 if ($this->_aSimilarRecommListIds === null) {
935 $this->_aSimilarRecommListIds =
false;
938 $this->_aSimilarRecommListIds = array($oProduct->getId());
952 if ($this->_oAccessoires === null) {
953 $this->_oAccessoires =
false;
955 $this->_oAccessoires = $oProduct->getAccessoires();
969 if ($this->_aAlsoBoughtArts === null) {
970 $this->_aAlsoBoughtArts =
false;
972 $this->_aAlsoBoughtArts = $oProduct->getCustomerAlsoBoughtThisProducts();
988 if (isset($oProduct->oxarticles__oxblfixedprice->value) && $oProduct->oxarticles__oxblfixedprice->value) {
1025 $this->_sSearchTitle = $sTitle;
1035 $this->_sCatTreePath = $sActCatPath;
1046 $sListType = $this->
getConfig()->getRequestParameter(
'listtype');
1047 if ($sListType && (
'vendor' == $sListType ||
'manufacturer' == $sListType)) {
1064 $sTitleField =
'oxarticles__oxtitle';
1065 $sVarSelField =
'oxarticles__oxvarselect';
1067 $sVarSelValue = $oProduct->$sVarSelField->value ?
' ' . $oProduct->$sVarSelField->value :
'';
1068 $sTagValue = !empty($sTag) ?
' - ' . $sTag :
'';
1070 return $oProduct->$sTitleField->value . $sVarSelValue . $sTagValue;
1085 if ($sTag = $this->
getTag()) {
1086 $sMeta = $sTag .
' - ' . $sMeta;
1113 if ($oProduct->oxarticles__oxparentid->value) {
1119 $sUrl = $oUtils->prepareCanonicalUrl($oProduct->getBaseSeoLink($oProduct->getLanguage(),
true));
1121 $sUrl = $oUtils->prepareCanonicalUrl($oProduct->getBaseStdLink($oProduct->getLanguage()));
1163 if ($this->_oCaptcha === null) {
1164 $this->_oCaptcha =
oxNew(
'oxCaptcha');
1185 $sMac = $this->
getConfig()->getRequestParameter(
'c_mac');
1186 $sMacHash = $this->
getConfig()->getRequestParameter(
'c_mach');
1188 if (!$oCaptcha->pass($sMac, $sMacHash)) {
1189 $this->_iPriceAlarmStatus = 2;
1194 $aParams = $this->
getConfig()->getRequestParameter(
'pa');
1195 if (!isset($aParams[
'email']) || !$myUtils->isValidEmail($aParams[
'email'])) {
1196 $this->_iPriceAlarmStatus = 0;
1200 $aParams[
'aid'] = $this->
getProduct()->getId();
1201 $oCur =
$myConfig->getActShopCurrencyObject();
1203 $dPrice = $myUtils->currency2Float($aParams[
'price']);
1205 $oAlarm =
oxNew(
"oxPriceAlarm");
1207 $oAlarm->oxpricealarm__oxemail =
new oxField($aParams[
'email']);
1208 $oAlarm->oxpricealarm__oxartid =
new oxField($aParams[
'aid']);
1209 $oAlarm->oxpricealarm__oxprice =
new oxField($myUtils->fRound($dPrice, $oCur));
1211 $oAlarm->oxpricealarm__oxcurrency =
new oxField($oCur->name);
1218 $oEmail =
oxNew(
'oxEmail');
1219 $this->_iPriceAlarmStatus = (int) $oEmail->sendPricealarmNotification($aParams, $oAlarm);
1239 if ($this->_sBidPrice === null) {
1240 $this->_sBidPrice =
false;
1242 $aParams = $this->
getConfig()->getRequestParameter(
'pa');
1243 $oCur = $this->
getConfig()->getActShopCurrencyObject();
1260 $sVarSelParameter = $this->
getConfig()->getRequestParameter(
"varselid");
1261 $sParentIdField =
'oxarticles__oxparentid';
1263 return $oParent->getVariantSelections($sVarSelParameter, $oProduct->getId());
1266 return $oProduct->getVariantSelections($sVarSelParameter);
1277 if ($aVariantSelections && $aVariantSelections[
'oActiveVariant'] && !$aVariantSelections[
'blPerfectFit']) {
1278 return $aVariantSelections[
'oActiveVariant'];
1291 if ($this->_sSearchParamForHtml === null) {
1292 $this->_sSearchParamForHtml = $this->
getConfig()->getRequestParameter(
'searchparam');
1305 return $this->
getConfig()->getConfigParam(
'blRDFaEmbedding');
1316 $iMin =
$myConfig->getConfigParam(
"iRDFaMinRating");
1317 $iMax =
$myConfig->getConfigParam(
"iRDFaMaxRating");
1320 $iCount = $oProduct->oxarticles__oxratingcnt->value;
1321 if (isset($iMin) && isset($iMax) && $iMax !=
'' && $iMin !=
'' && $iCount > 0) {
1322 $aNormalizedRating = array();
1323 $iValue = ((4 * ($oProduct->oxarticles__oxrating->value - $iMin) / ($iMax - $iMin))) + 1;
1324 $aNormalizedRating[
"count"] = $iCount;
1325 $aNormalizedRating[
"value"] = round($iValue, 2);
1327 return $aNormalizedRating;
1342 if ($sShopConfVar) {
1343 $aValidity = array();
1344 $iDays = $this->
getConfig()->getConfigParam($sShopConfVar);
1347 $iThrough = $iFrom + ($iDays * 24 * 60 * 60);
1348 $aValidity[
"from"] = date(
'Y-m-d\TH:i:s', $iFrom) .
"Z";
1349 $aValidity[
"through"] = date(
'Y-m-d\TH:i:s', $iThrough) .
"Z";
1364 return $this->
getConfig()->getConfigParam(
"sRDFaBusinessFnc");
1374 return $this->
getConfig()->getConfigParam(
"aRDFaCustomers");
1384 return $this->
getConfig()->getConfigParam(
"iRDFaVAT");
1394 return $this->
getConfig()->getConfigParam(
"iRDFaCondition");
1405 if ($oProduct && $oProduct->oxarticles__oxbundleid->value) {
1406 $oArticle =
oxNew(
"oxArticle");
1407 $oArticle->load($oProduct->oxarticles__oxbundleid->value);
1423 $iPrice = $this->
getProduct()->getPrice()->getBruttoPrice();
1424 $oPayments =
oxNew(
"oxPaymentList");
1425 $oPayments->loadRDFaPaymentList($iPrice);
1437 $oDelSets =
oxNew(
"oxDeliverySetList");
1438 $oDelSets->loadRDFaDeliverySetList();
1451 $oDelList =
oxNew(
"oxDeliveryList");
1452 $oDelList->loadDeliveryListForProduct($oProduct);
1464 return $this->
getConfig()->getConfigParam(
"sRDFaDeliveryChargeSpecLoc");
1474 return $this->
getConfig()->getConfigParam(
"sRDFaPaymentChargeSpecLoc");
1484 return $this->
getConfig()->getConfigParam(
"sRDFaBusinessEntityLoc");
1494 return $this->
getConfig()->getConfigParam(
"blShowRDFaProductStock");
1506 if ($oUser = $this->
getUser()) {
1524 $oTagList =
oxNew(
"oxArticleTagList");
1526 $oTagList->setArticleId($this->
getProduct()->getId());
1527 $oTagCloud =
oxNew(
"oxTagCloud");
1528 $oTagCloud->setTagList($oTagList);
1529 $oTagCloud->setExtendedMode(
true);
1543 return $aPicGallery[
'ZoomPic'];
1553 return $this->
getConfig()->getConfigParam(
'bl_perfLoadReviews');
1567 if ($sSortBy = $oCategory->getDefaultSorting()) {
1568 $sSortDir = ($oCategory->getDefaultSortingMode()) ?
"desc" :
"asc";
1569 $aSorting = array(
'sortby' => $sSortBy,
'sortdir' => $sSortDir);
1584 if (!is_array($aSorting)) {
1588 return implode(
'|', $aSorting);
1599 $aCatPath = array();
1601 $oCat =
oxNew(
'oxVendor');
1602 $oCat->load(
'root');
1604 $aCatPath[
'link'] = $oCat->getLink();
1605 $aCatPath[
'title'] = $oCat->oxvendor__oxtitle->value;
1606 $aPaths[] = $aCatPath;
1609 if (is_a($oCat,
'oxVendor')) {
1610 $aCatPath[
'link'] = $oCat->getLink();
1611 $aCatPath[
'title'] = $oCat->oxvendor__oxtitle->value;
1612 $aPaths[] = $aCatPath;
1628 $aCatPath = array();
1630 $aCatPath[
'title'] =
oxRegistry::getLang()->translateString(
'LISTMANIA', $iBaseLanguage,
false);
1631 $aPaths[] = $aCatPath;
1647 $aCatPath = array();
1652 $aCatPath[
'title'] =
oxRegistry::getLang()->translateString(
'TAGS', $iBaseLanguage,
false);
1653 $aCatPath[
'link'] =
oxRegistry::get(
"oxSeoEncoder")->getStaticUrl($sSelfLink .
'cl=tags');
1654 $aPaths[] = $aCatPath;
1658 $aCatPath[
'title'] = $oStr->ucfirst($sSearchTagParameter);
1659 $aCatPath[
'link'] =
oxRegistry::get(
"oxSeoEncoderTag")->getTagUrl($sSearchTagParameter);
1660 $aPaths[] = $aCatPath;
1673 $aCatPath = array();
1676 $sTranslatedString =
oxRegistry::getLang()->translateString(
'SEARCH_RESULT', $iBaseLanguage,
false);
1681 $aCatPath[
'link'] = $sSelfLink .
'stoken=' . $sSessionToken .
"&cl=search&".
1684 $aPaths[] = $aCatPath;
1702 foreach ($oCatTree as $oCat) {
1703 $aCatPath = array();
1705 $aCatPath[
'link'] = $oCat->getLink();
1706 $aCatPath[
'title'] = $oCat->oxcategories__oxtitle->value;
1708 $aPaths[] = $aCatPath;