158 if ( $sParentId && $this->_oParentProd === null ) {
159 $this->_oParentProd =
false;
160 $oProduct =
oxNew(
'oxArticle' );
161 if ( ( $oProduct->load( $sParentId ) ) ) {
163 $this->_oParentProd = $oProduct;
195 if ( !$aVarSelParams && !$aSelectListParams ) {
199 if ( $aVarSelParams ) {
200 foreach ( $aVarSelParams as $iKey => $sValue ) {
201 $aParams[
"varselid[$iKey]"] = $sValue;
205 if ( $aSelectListParams ) {
206 foreach ( $aSelectListParams as $iKey => $sValue ) {
207 $aParams[
"sel[$iKey]"] = $sValue;
225 $oProduct->appendLink( $sAddParams );
236 if ( isset( $this->_sViewId )) {
243 return $this->_sViewId = $sViewId;
265 if ( $oProduct->oxarticles__oxtemplate->value ) {
266 $this->_sThisTemplate = $oProduct->oxarticles__oxtemplate->value;
270 $this->_sThisTemplate =
'custom/'.basename ( $sTplName );
275 $sPartial = $this->
getConfig()->getRequestParameter(
'renderPartial' );
280 return 'page/details/ajax/fullproductinfo.tpl';
283 return 'page/details/ajax/productmain.tpl';
288 $oLocator->setLocatorData( $oProduct, $this );
291 $oRss =
oxNew(
'oxRssFeed');
292 $this->
addRssFeed($oRss->getRecommListsTitle( $oProduct ), $oRss->getRecommListsUrl( $oProduct ),
'recommlists');
315 if ( $this->
getConfig()->getConfigParam(
'bl_perfParseLongDescinSmarty' ) ) {
316 $sMeta = $oProduct->getLongDesc();
318 $sMeta = $oProduct->getLongDescription()->value;
320 if ( $sMeta ==
'' ) {
321 $sMeta = $oProduct->oxarticles__oxshortdesc->value;
323 $sMeta = $oProduct->oxarticles__oxtitle->value.
' - '.$sMeta;
342 $sKeywords = trim( $this->
getTitle() );
345 foreach ( $oCatTree->getPath() as $oCat ) {
346 $sKeywords .=
", " . trim( $oCat->oxcategories__oxtitle->value );
351 if ( $sSearchKeys = trim( $oProduct->oxarticles__oxsearchkeys->value ) ) {
352 $sKeywords .=
", ". $sSearchKeys;
375 $dRating = $this->
getConfig()->getRequestParameter(
'artrating' );
376 if ( $dRating !== null ) {
377 $dRating = (int) $dRating;
381 if ( $dRating !== null && $dRating >= 1 && $dRating <= 5 ) {
382 $oRating =
oxNew(
'oxrating' );
383 if ( $oRating->allowRating( $oUser->getId(),
'oxarticle', $oProduct->getId() ) ) {
384 $oRating->oxratings__oxuserid =
new oxField( $oUser->getId() );
385 $oRating->oxratings__oxtype =
new oxField(
'oxarticle' );
386 $oRating->oxratings__oxobjectid =
new oxField( $oProduct->getId() );
387 $oRating->oxratings__oxrating =
new oxField( $dRating );
389 $oProduct->addToRatingAverage( $dRating );
393 if ( ( $sReviewText = trim( (
string ) $this->
getConfig()->getRequestParameter(
'rvw_txt',
true ) ) ) ) {
394 $oReview =
oxNew(
'oxReview' );
395 $oReview->oxreviews__oxobjectid =
new oxField( $oProduct->getId() );
396 $oReview->oxreviews__oxtype =
new oxField(
'oxarticle' );
399 $oReview->oxreviews__oxuserid =
new oxField( $oUser->getId() );
400 $oReview->oxreviews__oxrating =
new oxField( ( $dRating !== null ) ? $dRating : 0);
421 $sRecommText = trim( (
string ) $this->
getConfig()->getRequestParameter(
'recomm_txt' ) );
422 $sRecommList = $this->
getConfig()->getRequestParameter(
'recomm' );
426 $oRecomm =
oxNew(
'oxrecommlist' );
427 $oRecomm->load( $sRecommList);
428 $oRecomm->addArticle( $sArtId, $sRecommText );
443 $sTags = $this->
getConfig()->getRequestParameter(
'newTags',
true );
444 $sHighTag = $this->
getConfig()->getRequestParameter(
'highTags',
true );
445 if ( !$sTags && !$sHighTag) {
449 $sTags =
getStr()->html_entity_decode( $sHighTag );
455 $aAddedTags = $aTaggedProducts? $aTaggedProducts[$oProduct->getId()] : array();
457 $oArticleTagList =
oxNew(
"oxArticleTagList" );
458 $oArticleTagList->load( $oProduct->getId() );
459 $sSeparator = $oArticleTagList->get()->getSeparator();
460 $aTags = array_unique( explode( $sSeparator, $sTags ) );
462 $aResult = $this->
_addTagsToList( $oArticleTagList, $aTags, $aAddedTags);
464 if ( !empty( $aResult[
'tags'] ) ) {
465 $oArticleTagList->save();
466 foreach ( $aResult[
'tags'] as $sTag) {
467 $aAddedTags[ $sTag ] = 1;
469 $aTaggedProducts[$oProduct->getId()] = $aAddedTags;
473 if ( $this->
getConfig()->getRequestParameter(
'blAjax',
true ) ) {
489 $aResult = array(
'tags' => array(),
'invalid' => array(),
'inlist' => array() );
491 foreach ( $aTags as $sTag ) {
492 $oTag =
oxNew(
"oxtag", $sTag );
493 if ( $aAddedTags[$oTag->get()] != 1 ) {
494 if ( $oTag->isValid() ) {
495 $oArticleTagList->addTag( $oTag );
496 $aResult[
'tags'][] = $oTag->get();
498 $aResult[
'invalid'][] = $oTag->get();
501 $aResult[
'inlist'][] = $oTag->get();
518 $oArticleTagList =
oxNew(
"oxArticleTagList");
519 $oArticleTagList->load( $this->
getProduct()->getId() );
520 $oTagSet = $oArticleTagList->get();
521 $this->_aTags = $oTagSet->get();
522 $this->_blEditTags =
true;
525 if ( $this->
getConfig()->getRequestParameter(
'blAjax',
true ) ) {
527 $oActView =
oxNew(
'oxubase' );
529 $oSmarty->assign(
'oView', $this );
531 oxRegistry::getUtils()->showMessageAndExit( $oSmarty->fetch(
'page/details/inc/editTags.tpl', $this->getViewId() ) );
542 $oArticleTagList =
oxNew(
"oxArticleTagList");
543 $oArticleTagList->load( $this->
getProduct()->getId() );
544 $oTagSet = $oArticleTagList->get();
545 $this->_aTags = $oTagSet->get();
546 $this->_blEditTags =
false;
551 $oActView =
oxNew(
'oxubase' );
553 $oSmarty->assign(
'oView', $this );
555 oxRegistry::getUtils()->showMessageAndExit( $oSmarty->fetch(
'page/details/inc/tags.tpl', $this->getViewId() ) );
567 return $oProduct->getId();
601 if ( $this->_oProduct === null ) {
605 $myConfig->setConfigParam(
'blLoadVariants',
true );
607 $sOxid = $this->
getConfig()->getRequestParameter(
'anid' );
610 $this->_oProduct =
oxNew(
'oxarticle' );
612 if ( !$this->_oProduct->load( $sOxid ) ) {
613 $myUtils->redirect(
$myConfig->getShopHomeURL() );
614 $myUtils->showMessageAndExit(
'' );
617 $aVariantSelections = $this->_oProduct->getVariantSelections( $this->
getConfig()->getRequestParameter(
"varselid" ) );
618 if ($aVariantSelections && $aVariantSelections[
'oActiveVariant'] && $aVariantSelections[
'blPerfectFit']) {
619 $this->_oProduct = $aVariantSelections[
'oActiveVariant'];
624 if ( !$this->_blIsInitialized ) {
627 if ( !$this->_oProduct->isVisible() ) {
629 } elseif ( $this->_oProduct->oxarticles__oxparentid->value ) {
630 $oParent = $this->
_getParentProduct( $this->_oProduct->oxarticles__oxparentid->value );
631 if ( !$oParent || !$oParent->isVisible() ) {
636 if ( !$blContinue ) {
637 $myUtils->redirect(
$myConfig->getShopHomeURL() );
638 $myUtils->showMessageAndExit(
'' );
642 $this->_blIsInitialized =
true;
655 if ( $this->_iLinkType === null ) {
656 $sListType = $this->
getConfig()->getRequestParameter(
'listtype' );
657 if (
'vendor' == $sListType ) {
659 } elseif (
'manufacturer' == $sListType ) {
661 } elseif (
'tag' == $sListType ) {
663 } elseif (
'recommlist' == $sListType ) {
697 if ( $this->_sParentName === null ) {
698 $this->_sParentName =
false;
700 $this->_sParentName = $oParent->oxarticles__oxtitle->value;
715 if ( $this->_sParentUrl === null ) {
716 $this->_sParentUrl =
false;
718 $this->_sParentUrl = $oParent->getLink();
731 if ( $this->_aPicGallery === null ) {
746 return $aPicGallery[
'ActPicID'];
757 return $aPicGallery[
'ActPic'];
768 return $aPicGallery[
'Pics'];
781 return $aPicGallery[
'Pics'][$sPicNr];
791 if ( $this->_aSelectLists === null ) {
792 $this->_aSelectLists =
false;
793 if ( $this->
getConfig()->getConfigParam(
'bl_perfLoadSelectLists' ) ) {
794 $this->_aSelectLists = $this->
getProduct()->getSelectLists();
807 if ( $this->_aReviews === null ) {
808 $this->_aReviews =
false;
809 if ( $this->
getConfig()->getConfigParam(
'bl_perfLoadReviews' ) ) {
810 $this->_aReviews = $this->
getProduct()->getReviews();
823 if ( $this->_oCrossSelling === null ) {
824 $this->_oCrossSelling =
false;
826 $this->_oCrossSelling = $oProduct->getCrossSelling();
839 if ( $this->_oSimilarProducts === null ) {
840 $this->_oSimilarProducts =
false;
842 $this->_oSimilarProducts = $oProduct->getSimilarProducts();
855 if ( $this->_aSimilarRecommListIds === null ) {
856 $this->_aSimilarRecommListIds =
false;
859 $this->_aSimilarRecommListIds = array( $oProduct->getId() );
872 if ( $this->_oAccessoires === null ) {
873 $this->_oAccessoires =
false;
875 $this->_oAccessoires = $oProduct->getAccessoires();
888 if ( $this->_aAlsoBoughtArts === null ) {
889 $this->_aAlsoBoughtArts =
false;
891 $this->_aAlsoBoughtArts = $oProduct->getCustomerAlsoBoughtThisProducts();
906 if ( isset( $oProduct->oxarticles__oxblfixedprice->value ) && $oProduct->oxarticles__oxblfixedprice->value ) {
944 $this->_sSearchTitle = $sTitle;
956 $this->_sCatTreePath = $sActCatPath;
967 $sListType = $this->
getConfig()->getRequestParameter(
'listtype' );
968 if ( $sListType && (
'vendor' == $sListType ||
'manufacturer' == $sListType ) ) {
983 return $oProduct->oxarticles__oxtitle->value . ( $oProduct->oxarticles__oxvarselect->value ?
' ' . $oProduct->oxarticles__oxvarselect->value :
'' ) . (!empty($sTag) ?
' - '.$sTag :
'');
996 if($sTag = $this->
getTag()) {
997 $sMeta = $sTag.
' - ' . $sMeta;
1021 if ( $oProduct->oxarticles__oxparentid->value ) {
1022 $oProduct = $this->
_getParentProduct( $oProduct->oxarticles__oxparentid->value );
1027 $sUrl = $oUtils->prepareCanonicalUrl( $oProduct->getBaseSeoLink( $oProduct->getLanguage(), true ) );
1029 $sUrl = $oUtils->prepareCanonicalUrl( $oProduct->getBaseStdLink( $oProduct->getLanguage() ) );
1046 } elseif (
'recommlist' == $this->
getListType() ) {
1063 if ( $this->_oCaptcha === null ) {
1064 $this->_oCaptcha =
oxNew(
'oxCaptcha');
1084 $sMac = $this->
getConfig()->getRequestParameter(
'c_mac' );
1085 $sMacHash = $this->
getConfig()->getRequestParameter(
'c_mach' );
1087 if ( !$oCaptcha->pass( $sMac, $sMacHash ) ) {
1088 $this->_iPriceAlarmStatus = 2;
1092 $aParams = $this->
getConfig()->getRequestParameter(
'pa' );
1093 if ( !isset( $aParams[
'email'] ) || !$myUtils->isValidEmail( $aParams[
'email'] ) ) {
1094 $this->_iPriceAlarmStatus = 0;
1097 $aParams[
'aid'] = $this->
getProduct()->getId();
1098 $oCur =
$myConfig->getActShopCurrencyObject();
1100 $dPrice = $myUtils->currency2Float( $aParams[
'price'] );
1102 $oAlarm =
oxNew(
"oxPriceAlarm" );
1104 $oAlarm->oxpricealarm__oxemail =
new oxField( $aParams[
'email']);
1105 $oAlarm->oxpricealarm__oxartid =
new oxField( $aParams[
'aid']);
1106 $oAlarm->oxpricealarm__oxprice =
new oxField( $myUtils->fRound( $dPrice, $oCur ));
1108 $oAlarm->oxpricealarm__oxcurrency =
new oxField( $oCur->name);
1115 $oEmail =
oxNew(
'oxEmail' );
1116 $this->_iPriceAlarmStatus = (int) $oEmail->sendPricealarmNotification( $aParams, $oAlarm );
1136 if ( $this->_sBidPrice === null ) {
1137 $this->_sBidPrice =
false;
1139 $aParams = $this->
getConfig()->getRequestParameter(
'pa' );
1140 $oCur = $this->
getConfig()->getActShopCurrencyObject();
1156 if ( ( $oParent = $this->
_getParentProduct( $oProduct->oxarticles__oxparentid->value ) ) ) {
1157 return $oParent->getVariantSelections( $this->
getConfig()->getRequestParameter(
"varselid" ), $oProduct->getId() );
1160 return $oProduct->getVariantSelections( $this->
getConfig()->getRequestParameter(
"varselid" ) );
1171 if ($aVariantSelections && $aVariantSelections[
'oActiveVariant'] && !$aVariantSelections[
'blPerfectFit']) {
1172 return $aVariantSelections[
'oActiveVariant'];
1184 if ( $this->_sSearchParamForHtml === null ) {
1185 $this->_sSearchParamForHtml = $this->
getConfig()->getRequestParameter(
'searchparam' );
1197 return $this->
getConfig()->getConfigParam(
'blRDFaEmbedding' );
1208 $iMin =
$myConfig->getConfigParam(
"iRDFaMinRating");
1209 $iMax =
$myConfig->getConfigParam(
"iRDFaMaxRating");
1212 $iCount = $oProduct->oxarticles__oxratingcnt->value;
1213 if ( isset($iMin) && isset($iMax) && $iMax !=
'' && $iMin !=
'' && $iCount > 0 ) {
1214 $aNormalizedRating = array();
1215 $iValue = ((4*($oProduct->oxarticles__oxrating->value - $iMin)/($iMax - $iMin)))+1;
1216 $aNormalizedRating[
"count"] = $iCount;
1217 $aNormalizedRating[
"value"] = round($iValue, 2);
1218 return $aNormalizedRating;
1232 if ( $sShopConfVar ) {
1233 $aValidity = array();
1234 $iDays = $this->
getConfig()->getConfigParam($sShopConfVar);
1237 $iThrough = $iFrom + ($iDays * 24 * 60 * 60);
1238 $aValidity[
"from"] = date(
'Y-m-d\TH:i:s', $iFrom).
"Z";
1239 $aValidity[
"through"] = date(
'Y-m-d\TH:i:s', $iThrough).
"Z";
1253 return $this->
getConfig()->getConfigParam(
"sRDFaBusinessFnc");
1263 return $this->
getConfig()->getConfigParam(
"aRDFaCustomers");
1273 return $this->
getConfig()->getConfigParam(
"iRDFaVAT");
1283 return $this->
getConfig()->getConfigParam(
"iRDFaCondition");
1294 if ( $oProduct && $oProduct->oxarticles__oxbundleid->value ) {
1295 $oArticle =
oxNew(
"oxArticle");
1296 $oArticle->load($oProduct->oxarticles__oxbundleid->value);
1309 $iPrice = $this->
getProduct()->getPrice()->getBruttoPrice();
1310 $oPayments =
oxNew(
"oxPaymentList");
1311 $oPayments->loadRDFaPaymentList($iPrice);
1322 $oDelSets =
oxNew(
"oxDeliverySetList");
1323 $oDelSets->loadRDFaDeliverySetList();
1335 $oDelList =
oxNew(
"oxDeliveryList" );
1336 $oDelList->loadDeliveryListForProduct( $oProduct );
1347 return $this->
getConfig()->getConfigParam(
"sRDFaDeliveryChargeSpecLoc");
1357 return $this->
getConfig()->getConfigParam(
"sRDFaPaymentChargeSpecLoc");
1367 return $this->
getConfig()->getConfigParam(
"sRDFaBusinessEntityLoc");
1377 return $this->
getConfig()->getConfigParam(
"blShowRDFaProductStock");
1387 if ( $oUser = $this->
getUser() ) {
1401 $oManager =
oxNew(
"oxTagCloud" );
1402 $oManager->setExtendedMode(
true );
1403 $oManager->setProductId( $this->
getProduct()->getId() );
1415 return $aPicGallery[
'ZoomPic'];
1425 return $this->
getConfig()->getConfigParam(
'bl_perfLoadReviews' );
1439 if ( $sSortBy = $oCategory->getDefaultSorting() ) {
1440 $sSortDir = ( $oCategory->getDefaultSortingMode() ) ?
"desc" :
"asc";
1441 $aSorting = array (
'sortby' => $sSortBy,
'sortdir' => $sSortDir );
1456 if ( !is_array( $aSorting ) ) {
1459 return implode(
'|', $aSorting);
1470 $aCatPath = array();
1472 $oCat =
oxNew(
'oxVendor' );
1473 $oCat->load(
'root' );
1475 $aCatPath[
'link'] = $oCat->getLink();
1476 $aCatPath[
'title'] = $oCat->oxvendor__oxtitle->value;
1477 $aPaths[] = $aCatPath;
1479 if (is_a($oCat,
'oxVendor')) {
1480 $aCatPath[
'link'] = $oCat->getLink();
1481 $aCatPath[
'title'] = $oCat->oxvendor__oxtitle->value;
1482 $aPaths[] = $aCatPath;
1496 $aCatPath = array();
1498 $aPaths[] = $aCatPath;
1511 $aCatPath = array();
1515 $aPaths[] = $aCatPath;
1520 $aPaths[] = $aCatPath;
1532 $aCatPath = array();
1537 $aPaths[] = $aCatPath;
1555 foreach ( $oCatTree as $oCat ) {
1556 $aCatPath = array();
1558 $aCatPath[
'link'] = $oCat->getLink();
1559 $aCatPath[
'title'] = $oCat->oxcategories__oxtitle->value;
1561 $aPaths[] = $aCatPath;