23 protected $_aReqFields = array(
'rec_name',
'rec_email',
'send_name',
'send_email',
'send_message',
'send_subject');
72 if (!is_array($aParams)) {
77 $oParams = (object) $aParams;
86 if (!$oCaptcha->pass($sMac, $sMacHash)) {
88 $oUtilsView->addErrorToDisplay(
'MESSAGE_WRONG_VERIFICATION_CODE');
94 foreach ($this->_aReqFields as $sFieldName) {
95 if (!isset($aParams[$sFieldName]) || !$aParams[$sFieldName]) {
96 $oUtilsView->addErrorToDisplay(
'SUGGEST_COMLETECORRECTLYFIELDS');
103 if (!$oUtils->isValidEmail($aParams[
"rec_email"]) || !$oUtils->isValidEmail($aParams[
"send_email"])) {
104 $oUtilsView->addErrorToDisplay(
'SUGGEST_INVALIDMAIL');
111 $sSearchParamForLink = rawurlencode(
oxRegistry::getConfig()->getRequestParameter(
'searchparam',
true));
112 if ($sSearchParamForLink) {
113 $sReturn .=
"&searchparam=$sSearchParamForLink";
118 $sReturn .=
"&searchcnid=$sSearchCatId";
122 if ($sSearchVendor) {
123 $sReturn .=
"&searchvendor=$sSearchVendor";
127 $sReturn .=
"&searchmanufacturer=$sSearchManufacturer";
132 $sReturn .=
"&listtype=$sListType";
136 $oEmail =
oxNew(
'oxemail');
138 if ($oProduct && $oEmail->sendSuggestMail($oParams, $oProduct)) {
139 return 'details?anid=' . $oProduct->getId() . $sReturn;
141 $oUtilsView->addErrorToDisplay(
'SUGGEST_INVALIDMAIL');
152 if ($this->_oProduct === null) {
153 $this->_oProduct =
false;
155 if ($sProductId = $this->
getConfig()->getRequestParameter(
'anid')) {
156 $oProduct =
oxNew(
'oxArticle');
157 $oProduct->load($sProductId);
158 $this->_oProduct = $oProduct;
172 if ($this->_oCrossSelling === null) {
173 $this->_oCrossSelling =
false;
175 $this->_oCrossSelling = $oProduct->getCrossSelling();
189 if ($this->_oSimilarProducts === null) {
190 $this->_oSimilarProducts =
false;
192 $this->_oSimilarProducts = $oProduct->getSimilarProducts();
210 if ($this->_oRecommList === null) {
211 $this->_oRecommList =
false;
213 $oRecommList =
oxNew(
'oxrecommlist');
214 $this->_oRecommList = $oRecommList->getRecommListsByIds(array($oProduct->getId()));
228 $this->_aSuggestData = $oData;
254 $sLink .= ((strpos($sLink,
'?') ===
false) ?
'?' :
'&') .
"cnid={$sVal}";
259 $sLink .= ((strpos($sLink,
'?') ===
false) ?
'?' :
'&') .
"anid={$sVal}";
272 if ($this->_oCaptcha === null) {
273 $this->_oCaptcha =
oxNew(
'oxCaptcha');
289 $aPath[
'title'] =
oxRegistry::getLang()->translateString(
'RECOMMEND_PRODUCT', $iBaseLanguage,
false);
290 $aPath[
'link'] = $this->
getLink();