Index: branches/5.2.x/units/products/products_tag_processor.php =================================================================== diff -u -N -r14908 -r14918 --- branches/5.2.x/units/products/products_tag_processor.php (.../products_tag_processor.php) (revision 14908) +++ branches/5.2.x/units/products/products_tag_processor.php (.../products_tag_processor.php) (revision 14918) @@ -1,6 +1,6 @@ GetID(), $products); } + + /** + * Checks if given field is filled for at least one product in comparison page + * + * @param Array $params + * @return string + * @access protected + */ + protected function HasCompareField($params) + { + $object =& $this->GetList($params); + + $object->GoFirst(); + $field = $this->SelectParam($params, 'name,field'); + + while ( !$object->EOL() ) { + if ( $object->GetField($field) ) { + // don't use GetCol, since it fails to process ML fields + return true; + } + + $object->GoNext(); + } + + return false; + } + + /** + * Builds link to product compare page + * + * @param Array $params + * @return string + * @access protected + */ + protected function CompareLink($params) + { + $params['continue'] = urlencode($this->Application->HREF('__default__', '', Array ('pass_category' => 1))); + + return $this->Application->ProcessParsedTag('m', 'Link', $params); + } + + /** + * Builds link to continue website browsing from compare products page + * + * @param Array $params + * @return string + * @access protected + */ + protected function ContinueLink($params) + { + $url = $this->Application->GetVar('continue'); + + if ( isset($params['redirect']) && $params['redirect'] ) { + $this->Application->Redirect('external:' . $url); + } + + return $url; + } } \ No newline at end of file