20 protected $_aReqFields = array(
'rec_name',
'rec_email',
'send_name',
'send_email',
'send_message',
'send_subject' );
64 if ( !is_array( $aParams ) ) {
69 $oParams = (object) $aParams;
78 if ( !$oCaptcha->pass( $sMac, $sMacHash ) ) {
80 $oUtilsView->addErrorToDisplay(
'MESSAGE_WRONG_VERIFICATION_CODE' );
85 foreach ( $this->_aReqFields as $sFieldName ) {
86 if ( !isset( $aParams[$sFieldName] ) || !$aParams[$sFieldName] ) {
87 $oUtilsView->addErrorToDisplay(
'SUGGEST_COMLETECORRECTLYFIELDS' );
93 if ( !$oUtils->isValidEmail( $aParams[
"rec_email"] ) || !$oUtils->isValidEmail( $aParams[
"send_email"] ) ) {
94 $oUtilsView->addErrorToDisplay(
'SUGGEST_INVALIDMAIL' );
101 if ( $sSearchParamForLink ) {
102 $sReturn .=
"&searchparam=$sSearchParamForLink";
106 if ( $sSearchCatId ) {
107 $sReturn .=
"&searchcnid=$sSearchCatId";
111 if ( $sSearchVendor ) {
112 $sReturn .=
"&searchvendor=$sSearchVendor";
116 $sReturn .=
"&searchmanufacturer=$sSearchManufacturer";
121 $sReturn .=
"&listtype=$sListType";
125 $oEmail =
oxNew(
'oxemail' );
127 if ( $oProduct && $oEmail->sendSuggestMail( $oParams, $oProduct ) ) {
128 return 'details?anid='.$oProduct->getId().$sReturn;
130 $oUtilsView->addErrorToDisplay(
'SUGGEST_INVALIDMAIL');
141 if ( $this->_oProduct === null ) {
142 $this->_oProduct =
false;
144 if ( $sProductId = $this->
getConfig()->getRequestParameter(
'anid' ) ) {
145 $oProduct =
oxNew(
'oxArticle' );
146 $oProduct->load( $sProductId );
147 $this->_oProduct = $oProduct;
160 if ( $this->_oCrossSelling === null ) {
161 $this->_oCrossSelling =
false;
163 $this->_oCrossSelling = $oProduct->getCrossSelling();
176 if ( $this->_oSimilarProducts === null ) {
177 $this->_oSimilarProducts =
false;
179 $this->_oSimilarProducts = $oProduct->getSimilarProducts();
196 if ( $this->_oRecommList === null ) {
197 $this->_oRecommList =
false;
199 $oRecommList =
oxNew(
'oxrecommlist');
200 $this->_oRecommList = $oRecommList->getRecommListsByIds( array( $oProduct->getId() ) );
215 $this->_aSuggestData = $oData;
241 $sLink .= ( ( strpos( $sLink,
'?' ) === false ) ?
'?' :
'&' ) .
"cnid={$sVal}";
246 $sLink .= ( ( strpos( $sLink,
'?' ) === false ) ?
'?' :
'&' ) .
"anid={$sVal}";
259 if ( $this->_oCaptcha === null ) {
260 $this->_oCaptcha =
oxNew(
'oxCaptcha');
275 $aPath[
'link'] = $this->
getLink();