Hi,

just a small addition:
if you use

oxUtils::getInstance()->redirect($oArticle->getLink());

instead of setting the header, you don't need to replace the "&" in the URL (that is done in redirect() already)

Cheers,
Stefan

Am 15.04.2010 17:38, schrieb Achim Leinberger:
This has been resolved by leofonic:

module for alist and search:

<?php
class redirectalist extends redirectalist_parent{
     public function render()
     {
         parent::render();
         if ($this->_iAllArtCnt==1){
             foreach ($this->getArticleList() as $oArticle){
                 $sLoc = str_replace('&amp;','&',$oArticle->getLink());
                 header("Location: ".$sLoc, true, 301);
                 exit();
             }
         }
         return $this->getTemplateName();
     }
}
?>


-----Ursprungliche Nachricht-----
Von: [email protected]
[mailto:[email protected]]im Auftrag von Achim
Leinberger
Gesendet: Mittwoch, 14. April 2010 19:00
An: [email protected]
Betreff: [oxid-dev-general] Classes alist / search: Redirect to product
whenonly 1 in list


Hi,

when the search or a category listing merely produces 1 result, it would be
good to render the resulting product and not list it.

The classes alist and search both have an object "$this->_iAllArtCnt" which
could be used to determine that in fact there is only 1 product.

The product data are in the $this->getArticleList() object.

I am looking for help on 2 aspects:

1. How do I query the getArticleList-object in order to
2. redirect the page rendering to the details class.

Any help is greatly appreciated!
Achim


_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general


_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general


--
*******************************************
Stefan Moises
Senior Softwareentwickler

shoptimax GmbH
Guntherstraße 45 a
90461 Nürnberg
Amtsgericht Nürnberg HRB 21703
GF Friedrich Schreieck

Tel.: 0911/25566-25
Fax:  0911/25566-29
[email protected]
http://www.shoptimax.de
*******************************************

_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general

Reply via email to