23 protected $_aReqFields = array(
'rec_name',
'rec_email',
'send_name',
'send_email',
'send_message',
'send_subject');
78 if (!is_array($aParams)) {
83 $oParams = (object) $aParams;
92 if (!$oCaptcha->pass($sMac, $sMacHash)) {
94 $oUtilsView->addErrorToDisplay(
'MESSAGE_WRONG_VERIFICATION_CODE');
100 foreach ($this->_aReqFields as $sFieldName) {
101 if (!isset($aParams[$sFieldName]) || !$aParams[$sFieldName]) {
102 $oUtilsView->addErrorToDisplay(
'SUGGEST_COMLETECORRECTLYFIELDS');
109 if (!$oUtils->isValidEmail($aParams[
"rec_email"]) || !$oUtils->isValidEmail($aParams[
"send_email"])) {
110 $oUtilsView->addErrorToDisplay(
'SUGGEST_INVALIDMAIL');
117 $sSearchParamForLink = rawurlencode(
oxRegistry::getConfig()->getRequestParameter(
'searchparam',
true));
118 if ($sSearchParamForLink) {
119 $sReturn .=
"&searchparam=$sSearchParamForLink";
124 $sReturn .=
"&searchcnid=$sSearchCatId";
128 if ($sSearchVendor) {
129 $sReturn .=
"&searchvendor=$sSearchVendor";
133 $sReturn .=
"&searchmanufacturer=$sSearchManufacturer";
138 $sReturn .=
"&listtype=$sListType";
142 $oEmail =
oxNew(
'oxemail');
144 if ($oProduct && $oEmail->sendSuggestMail($oParams, $oProduct)) {
145 return 'details?anid=' . $oProduct->getId() . $sReturn;
147 $oUtilsView->addErrorToDisplay(
'SUGGEST_INVALIDMAIL');
158 if ($this->_oProduct === null) {
159 $this->_oProduct =
false;
161 if ($sProductId = $this->
getConfig()->getRequestParameter(
'anid')) {
162 $oProduct =
oxNew(
'oxArticle');
163 $oProduct->load($sProductId);
164 $this->_oProduct = $oProduct;
178 if ($this->_oCrossSelling === null) {
179 $this->_oCrossSelling =
false;
181 $this->_oCrossSelling = $oProduct->getCrossSelling();
195 if ($this->_oSimilarProducts === null) {
196 $this->_oSimilarProducts =
false;
198 $this->_oSimilarProducts = $oProduct->getSimilarProducts();
218 if ($this->_oRecommList === null) {
219 $this->_oRecommList =
false;
221 $oRecommList =
oxNew(
'oxrecommlist');
222 $this->_oRecommList = $oRecommList->getRecommListsByIds(array($oProduct->getId()));
236 $this->_aSuggestData = $oData;
262 $sLink .= ((strpos($sLink,
'?') ===
false) ?
'?' :
'&') .
"cnid={$sVal}";
267 $sLink .= ((strpos($sLink,
'?') ===
false) ?
'?' :
'&') .
"anid={$sVal}";
282 if ($this->_oCaptcha === null) {
283 $this->_oCaptcha =
oxNew(
'oxCaptcha');
299 $aPath[
'title'] =
oxRegistry::getLang()->translateString(
'RECOMMEND_PRODUCT', $iBaseLanguage,
false);
300 $aPath[
'link'] = $this->
getLink();