sGetComparisons example


        return $this->productComparisons->sAddComparison($article);
    }

    /** * Get all products from comparision chart * * @return array Associative array with all articles or empty array */
    public function sGetComparisons()
    {
        return $this->productComparisons->sGetComparisons();
    }

    /** * Get all products and a table of their properties as an array * * @return array Associative array with all products or empty array */
    public function sGetComparisonList()
    {
        return $this->productComparisons->sGetComparisonList();
    }

    

    protected $articles;

    public function preDispatch()
    {
        $this->View()->setScope(Enlight_Template_Manager::SCOPE_PARENT);
        $this->articles = Shopware()->Modules()->Articles();
    }

    public function indexAction()
    {
        $this->View()->assign('sComparisons', $this->articles->sGetComparisons());
    }

    public function addArticleAction()
    {
        if (($productId = $this->Request()->getParam('articleID')) !== null) {
            $this->View()->assign('sCompareAddResult', $this->articles->sAddComparison($productId));
        }
        $this->View()->assign('sComparisons', $this->articles->sGetComparisons());
    }

    public function deleteArticleAction()
    {

    /** * Pre dispatch method */
    public function preDispatch()
    {
        $this->Response()->setHeader('x-robots-tag', 'noindex');
    }

    public function indexAction()
    {
        $this->View()->assign('sComparisons', Shopware()->Modules()->Articles()->sGetComparisons());
    }
}
Home | Imprint | This part of the site doesn't use cookies.