177 if ($sParentId && $this->_oParentProd === null) {
178 $this->_oParentProd =
false;
179 $oProduct =
oxNew(
'oxArticle');
180 if (($oProduct->load($sParentId))) {
182 $this->_oParentProd = $oProduct;
215 if (!$aVarSelParams && !$aSelectListParams) {
219 if ($aVarSelParams) {
220 foreach ($aVarSelParams as $iKey => $sValue) {
221 $aParams[
"varselid[$iKey]"] = $sValue;
225 if ($aSelectListParams) {
226 foreach ($aSelectListParams as $iKey => $sValue) {
227 $aParams[
"sel[$iKey]"] = $sValue;
244 $oProduct->appendLink($sAddParams);
255 if (isset($this->_sViewId)) {
262 return $this->_sViewId = $sViewId;
284 if ($oProduct->oxarticles__oxtemplate->value) {
285 $this->_sThisTemplate = $oProduct->oxarticles__oxtemplate->value;
289 $this->_sThisTemplate =
'custom/' . basename($sTplName);
294 $sPartial = $this->
getConfig()->getRequestParameter(
'renderPartial');
299 return 'page/details/ajax/fullproductinfo.tpl';
302 return 'page/details/ajax/productmain.tpl';
307 $oLocator->setLocatorData($oProduct, $this);
310 $oRss =
oxNew(
'oxRssFeed');
311 $sTitle = $oRss->getRecommListsTitle($oProduct);
312 $sUrl = $oRss->getRecommListsUrl($oProduct);
313 $this->
addRssFeed($sTitle, $sUrl,
'recommlists');
336 if ($this->
getConfig()->getConfigParam(
'bl_perfParseLongDescinSmarty')) {
337 $sMeta = $oProduct->getLongDesc();
339 $sMeta = $oProduct->getLongDescription()->value;
342 $sMeta = $oProduct->oxarticles__oxshortdesc->value;
344 $sMeta = $oProduct->oxarticles__oxtitle->value .
' - ' . $sMeta;
364 $sKeywords = trim($this->
getTitle());
367 foreach ($oCatTree->getPath() as $oCat) {
368 $sKeywords .=
", " . trim($oCat->oxcategories__oxtitle->value);
373 if ($sSearchKeys = trim($oProduct->oxarticles__oxsearchkeys->value)) {
374 $sKeywords .=
", " . $sSearchKeys;
398 $dRating = $this->
getConfig()->getRequestParameter(
'artrating');
399 if ($dRating !== null) {
400 $dRating = (int) $dRating;
404 if ($dRating !== null && $dRating >= 1 && $dRating <= 5) {
405 $oRating =
oxNew(
'oxrating');
406 if ($oRating->allowRating($oUser->getId(),
'oxarticle', $oProduct->getId())) {
407 $oRating->oxratings__oxuserid =
new oxField($oUser->getId());
408 $oRating->oxratings__oxtype =
new oxField(
'oxarticle');
409 $oRating->oxratings__oxobjectid =
new oxField($oProduct->getId());
410 $oRating->oxratings__oxrating =
new oxField($dRating);
412 $oProduct->addToRatingAverage($dRating);
416 if (($sReviewText = trim((
string ) $this->
getConfig()->getRequestParameter(
'rvw_txt',
true)))) {
417 $oReview =
oxNew(
'oxReview');
418 $oReview->oxreviews__oxobjectid =
new oxField($oProduct->getId());
419 $oReview->oxreviews__oxtype =
new oxField(
'oxarticle');
422 $oReview->oxreviews__oxuserid =
new oxField($oUser->getId());
423 $oReview->oxreviews__oxrating =
new oxField(($dRating !== null) ? $dRating : 0);
444 $sRecommText = trim((
string ) $this->
getConfig()->getRequestParameter(
'recomm_txt'));
445 $sRecommList = $this->
getConfig()->getRequestParameter(
'recomm');
449 $oRecomm =
oxNew(
'oxrecommlist');
450 $oRecomm->load($sRecommList);
451 $oRecomm->addArticle($sArtId, $sRecommText);
466 $sTags = $this->
getConfig()->getRequestParameter(
'newTags',
true);
467 $sHighTag = $this->
getConfig()->getRequestParameter(
'highTags',
true);
468 if (!$sTags && !$sHighTag) {
472 $sTags =
getStr()->html_entity_decode($sHighTag);
478 $aAddedTags = $aTaggedProducts ? $aTaggedProducts[$oProduct->getId()] : array();
480 $oArticleTagList =
oxNew(
"oxArticleTagList");
481 $oArticleTagList->load($oProduct->getId());
482 $sSeparator = $oArticleTagList->get()->getSeparator();
483 $aTags = array_unique(explode($sSeparator, $sTags));
485 $aResult = $this->
_addTagsToList($oArticleTagList, $aTags, $aAddedTags);
487 if (!empty($aResult[
'tags'])) {
488 $oArticleTagList->save();
489 foreach ($aResult[
'tags'] as $sTag) {
490 $aAddedTags[$sTag] = 1;
492 $aTaggedProducts[$oProduct->getId()] = $aAddedTags;
496 if ($this->
getConfig()->getRequestParameter(
'blAjax',
true)) {
512 $aResult = array(
'tags' => array(),
'invalid' => array(),
'inlist' => array());
514 foreach ($aTags as $sTag) {
515 $oTag =
oxNew(
"oxtag", $sTag);
516 if ($aAddedTags[$oTag->get()] != 1) {
517 if ($oTag->isValid()) {
518 $oArticleTagList->addTag($oTag);
519 $aResult[
'tags'][] = $oTag->get();
521 $aResult[
'invalid'][] = $oTag->get();
524 $aResult[
'inlist'][] = $oTag->get();
541 $oArticleTagList =
oxNew(
"oxArticleTagList");
542 $oArticleTagList->load($this->
getProduct()->getId());
543 $oTagSet = $oArticleTagList->get();
544 $this->_aTags = $oTagSet->get();
545 $this->_blEditTags =
true;
548 if ($this->
getConfig()->getRequestParameter(
'blAjax',
true)) {
551 $oActView =
oxNew(
'oxubase');
553 $oSmarty->assign(
'oView', $this);
556 $oSmarty->fetch(
'page/details/inc/editTags.tpl', $this->getViewId())
566 $oArticleTagList =
oxNew(
"oxArticleTagList");
567 $oArticleTagList->load($this->
getProduct()->getId());
568 $oTagSet = $oArticleTagList->get();
569 $this->_aTags = $oTagSet->get();
570 $this->_blEditTags =
false;
576 $oActView =
oxNew(
'oxubase');
578 $oSmarty->assign(
'oView', $this);
581 $oSmarty->fetch(
'page/details/inc/tags.tpl', $this->getViewId())
594 return $oProduct->getId();
628 if ($this->_oProduct === null) {
632 $oConfig->setConfigParam(
'blLoadVariants',
true);
634 $sOxid = $this->
getConfig()->getRequestParameter(
'anid');
637 $this->_oProduct =
oxNew(
'oxarticle');
639 if (!$this->_oProduct->load($sOxid)) {
640 $oUtils->redirect($oConfig->getShopHomeURL());
641 $oUtils->showMessageAndExit(
'');
644 $sVarSelIdParameter = $this->
getConfig()->getRequestParameter(
"varselid");
645 $aVariantSelections = $this->_oProduct->getVariantSelections($sVarSelIdParameter);
646 if ($aVariantSelections && $aVariantSelections[
'oActiveVariant'] && $aVariantSelections[
'blPerfectFit']) {
647 $this->_oProduct = $aVariantSelections[
'oActiveVariant'];
652 if (!$this->_blIsInitialized) {
668 if (!$this->_oProduct->isVisible()) {
670 } elseif ($this->_oProduct->oxarticles__oxparentid->value) {
671 $oParent = $this->
_getParentProduct($this->_oProduct->oxarticles__oxparentid->value);
672 if (!$oParent || !$oParent->isVisible()) {
678 $oUtils->redirect($oConfig->getShopHomeURL());
679 $oUtils->showMessageAndExit(
'');
683 $this->_blIsInitialized =
true;
693 if ($this->_iLinkType === null) {
694 $sListType = $this->
getConfig()->getRequestParameter(
'listtype');
695 if (
'vendor' == $sListType) {
697 } elseif (
'manufacturer' == $sListType) {
699 } elseif (
'tag' == $sListType) {
701 } elseif (
'recommlist' == $sListType) {
735 if ($this->_sParentName === null) {
736 $this->_sParentName =
false;
738 $this->_sParentName = $oParent->oxarticles__oxtitle->value;
754 if ($this->_sParentUrl === null) {
755 $this->_sParentUrl =
false;
757 $this->_sParentUrl = $oParent->getLink();
771 if ($this->_aPicGallery === null) {
788 return $aPicGallery[
'ActPicID'];
800 return $aPicGallery[
'ActPic'];
812 return $aPicGallery[
'Pics'];
826 return $aPicGallery[
'Pics'][$sPicNr];
836 if ($this->_aSelectLists === null) {
837 $this->_aSelectLists =
false;
838 if ($this->
getConfig()->getConfigParam(
'bl_perfLoadSelectLists')) {
839 $this->_aSelectLists = $this->
getProduct()->getSelectLists();
853 if ($this->_aReviews === null) {
854 $this->_aReviews =
false;
855 if ($this->
getConfig()->getConfigParam(
'bl_perfLoadReviews')) {
856 $this->_aReviews = $this->
getProduct()->getReviews();
870 if ($this->_oCrossSelling === null) {
871 $this->_oCrossSelling =
false;
873 $this->_oCrossSelling = $oProduct->getCrossSelling();
887 if ($this->_oSimilarProducts === null) {
888 $this->_oSimilarProducts =
false;
890 $this->_oSimilarProducts = $oProduct->getSimilarProducts();
904 if ($this->_aSimilarRecommListIds === null) {
905 $this->_aSimilarRecommListIds =
false;
908 $this->_aSimilarRecommListIds = array($oProduct->getId());
922 if ($this->_oAccessoires === null) {
923 $this->_oAccessoires =
false;
925 $this->_oAccessoires = $oProduct->getAccessoires();
939 if ($this->_aAlsoBoughtArts === null) {
940 $this->_aAlsoBoughtArts =
false;
942 $this->_aAlsoBoughtArts = $oProduct->getCustomerAlsoBoughtThisProducts();
958 if (isset($oProduct->oxarticles__oxblfixedprice->value) && $oProduct->oxarticles__oxblfixedprice->value) {
995 $this->_sSearchTitle = $sTitle;
1005 $this->_sCatTreePath = $sActCatPath;
1016 $sListType = $this->
getConfig()->getRequestParameter(
'listtype');
1017 if ($sListType && (
'vendor' == $sListType ||
'manufacturer' == $sListType)) {
1033 $sTitleField =
'oxarticles__oxtitle';
1034 $sVarSelField =
'oxarticles__oxvarselect';
1036 $sVarSelValue = $oProduct->$sVarSelField->value ?
' ' . $oProduct->$sVarSelField->value :
'';
1037 $sTagValue = !empty($sTag) ?
' - ' . $sTag :
'';
1039 return $oProduct->$sTitleField->value . $sVarSelValue . $sTagValue;
1052 if ($sTag = $this->
getTag()) {
1053 $sMeta = $sTag .
' - ' . $sMeta;
1077 if ($oProduct->oxarticles__oxparentid->value) {
1083 $sUrl = $oUtils->prepareCanonicalUrl($oProduct->getBaseSeoLink($oProduct->getLanguage(),
true));
1085 $sUrl = $oUtils->prepareCanonicalUrl($oProduct->getBaseStdLink($oProduct->getLanguage()));
1121 if ($this->_oCaptcha === null) {
1122 $this->_oCaptcha =
oxNew(
'oxCaptcha');
1143 $sMac = $this->
getConfig()->getRequestParameter(
'c_mac');
1144 $sMacHash = $this->
getConfig()->getRequestParameter(
'c_mach');
1146 if (!$oCaptcha->pass($sMac, $sMacHash)) {
1147 $this->_iPriceAlarmStatus = 2;
1152 $aParams = $this->
getConfig()->getRequestParameter(
'pa');
1153 if (!isset($aParams[
'email']) || !$myUtils->isValidEmail($aParams[
'email'])) {
1154 $this->_iPriceAlarmStatus = 0;
1158 $aParams[
'aid'] = $this->
getProduct()->getId();
1159 $oCur =
$myConfig->getActShopCurrencyObject();
1161 $dPrice = $myUtils->currency2Float($aParams[
'price']);
1163 $oAlarm =
oxNew(
"oxPriceAlarm");
1165 $oAlarm->oxpricealarm__oxemail =
new oxField($aParams[
'email']);
1166 $oAlarm->oxpricealarm__oxartid =
new oxField($aParams[
'aid']);
1167 $oAlarm->oxpricealarm__oxprice =
new oxField($myUtils->fRound($dPrice, $oCur));
1169 $oAlarm->oxpricealarm__oxcurrency =
new oxField($oCur->name);
1176 $oEmail =
oxNew(
'oxEmail');
1177 $this->_iPriceAlarmStatus = (int) $oEmail->sendPricealarmNotification($aParams, $oAlarm);
1197 if ($this->_sBidPrice === null) {
1198 $this->_sBidPrice =
false;
1200 $aParams = $this->
getConfig()->getRequestParameter(
'pa');
1201 $oCur = $this->
getConfig()->getActShopCurrencyObject();
1218 $sVarSelParameter = $this->
getConfig()->getRequestParameter(
"varselid");
1219 $sParentIdField =
'oxarticles__oxparentid';
1221 return $oParent->getVariantSelections($sVarSelParameter, $oProduct->getId());
1224 return $oProduct->getVariantSelections($sVarSelParameter);
1235 if ($aVariantSelections && $aVariantSelections[
'oActiveVariant'] && !$aVariantSelections[
'blPerfectFit']) {
1236 return $aVariantSelections[
'oActiveVariant'];
1249 if ($this->_sSearchParamForHtml === null) {
1250 $this->_sSearchParamForHtml = $this->
getConfig()->getRequestParameter(
'searchparam');
1263 return $this->
getConfig()->getConfigParam(
'blRDFaEmbedding');
1274 $iMin =
$myConfig->getConfigParam(
"iRDFaMinRating");
1275 $iMax =
$myConfig->getConfigParam(
"iRDFaMaxRating");
1278 $iCount = $oProduct->oxarticles__oxratingcnt->value;
1279 if (isset($iMin) && isset($iMax) && $iMax !=
'' && $iMin !=
'' && $iCount > 0) {
1280 $aNormalizedRating = array();
1281 $iValue = ((4 * ($oProduct->oxarticles__oxrating->value - $iMin) / ($iMax - $iMin))) + 1;
1282 $aNormalizedRating[
"count"] = $iCount;
1283 $aNormalizedRating[
"value"] = round($iValue, 2);
1285 return $aNormalizedRating;
1300 if ($sShopConfVar) {
1301 $aValidity = array();
1302 $iDays = $this->
getConfig()->getConfigParam($sShopConfVar);
1305 $iThrough = $iFrom + ($iDays * 24 * 60 * 60);
1306 $aValidity[
"from"] = date(
'Y-m-d\TH:i:s', $iFrom) .
"Z";
1307 $aValidity[
"through"] = date(
'Y-m-d\TH:i:s', $iThrough) .
"Z";
1322 return $this->
getConfig()->getConfigParam(
"sRDFaBusinessFnc");
1332 return $this->
getConfig()->getConfigParam(
"aRDFaCustomers");
1342 return $this->
getConfig()->getConfigParam(
"iRDFaVAT");
1352 return $this->
getConfig()->getConfigParam(
"iRDFaCondition");
1363 if ($oProduct && $oProduct->oxarticles__oxbundleid->value) {
1364 $oArticle =
oxNew(
"oxArticle");
1365 $oArticle->load($oProduct->oxarticles__oxbundleid->value);
1381 $iPrice = $this->
getProduct()->getPrice()->getBruttoPrice();
1382 $oPayments =
oxNew(
"oxPaymentList");
1383 $oPayments->loadRDFaPaymentList($iPrice);
1395 $oDelSets =
oxNew(
"oxDeliverySetList");
1396 $oDelSets->loadRDFaDeliverySetList();
1409 $oDelList =
oxNew(
"oxDeliveryList");
1410 $oDelList->loadDeliveryListForProduct($oProduct);
1422 return $this->
getConfig()->getConfigParam(
"sRDFaDeliveryChargeSpecLoc");
1432 return $this->
getConfig()->getConfigParam(
"sRDFaPaymentChargeSpecLoc");
1442 return $this->
getConfig()->getConfigParam(
"sRDFaBusinessEntityLoc");
1452 return $this->
getConfig()->getConfigParam(
"blShowRDFaProductStock");
1462 if ($oUser = $this->
getUser()) {
1478 $oTagList =
oxNew(
"oxArticleTagList");
1480 $oTagList->setArticleId($this->
getProduct()->getId());
1481 $oTagCloud =
oxNew(
"oxTagCloud");
1482 $oTagCloud->setTagList($oTagList);
1483 $oTagCloud->setExtendedMode(
true);
1497 return $aPicGallery[
'ZoomPic'];
1507 return $this->
getConfig()->getConfigParam(
'bl_perfLoadReviews');
1521 if ($sSortBy = $oCategory->getDefaultSorting()) {
1522 $sSortDir = ($oCategory->getDefaultSortingMode()) ?
"desc" :
"asc";
1523 $aSorting = array(
'sortby' => $sSortBy,
'sortdir' => $sSortDir);
1538 if (!is_array($aSorting)) {
1542 return implode(
'|', $aSorting);
1553 $aCatPath = array();
1555 $oCat =
oxNew(
'oxVendor');
1556 $oCat->load(
'root');
1558 $aCatPath[
'link'] = $oCat->getLink();
1559 $aCatPath[
'title'] = $oCat->oxvendor__oxtitle->value;
1560 $aPaths[] = $aCatPath;
1563 if (is_a($oCat,
'oxVendor')) {
1564 $aCatPath[
'link'] = $oCat->getLink();
1565 $aCatPath[
'title'] = $oCat->oxvendor__oxtitle->value;
1566 $aPaths[] = $aCatPath;
1580 $aCatPath = array();
1582 $aCatPath[
'title'] =
oxRegistry::getLang()->translateString(
'LISTMANIA', $iBaseLanguage,
false);
1583 $aPaths[] = $aCatPath;
1597 $aCatPath = array();
1602 $aCatPath[
'title'] =
oxRegistry::getLang()->translateString(
'TAGS', $iBaseLanguage,
false);
1603 $aCatPath[
'link'] =
oxRegistry::get(
"oxSeoEncoder")->getStaticUrl($sSelfLink .
'cl=tags');
1604 $aPaths[] = $aCatPath;
1608 $aCatPath[
'title'] = $oStr->ucfirst($sSearchTagParameter);
1609 $aCatPath[
'link'] =
oxRegistry::get(
"oxSeoEncoderTag")->getTagUrl($sSearchTagParameter);
1610 $aPaths[] = $aCatPath;
1623 $aCatPath = array();
1626 $sTranslatedString =
oxRegistry::getLang()->translateString(
'SEARCH_RESULT', $iBaseLanguage,
false);
1631 $aCatPath[
'link'] = $sSelfLink .
'stoken=' . $sSessionToken .
"&cl=search&".
1634 $aPaths[] = $aCatPath;
1652 foreach ($oCatTree as $oCat) {
1653 $aCatPath = array();
1655 $aCatPath[
'link'] = $oCat->getLink();
1656 $aCatPath[
'title'] = $oCat->oxcategories__oxtitle->value;
1658 $aPaths[] = $aCatPath;