sAddComparison example



    /** * Insert products in comparision chart * * @param int $article s_articles.id * * @return bool true/false */
    public function sAddComparison($article)
    {
        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();
    }

    
$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()
    {
        if (($productId = $this->Request()->getParam('articleID')) !== null) {
            $this->articles->sDeleteComparison((int) $productId);
        }
        $this->forward('index');
    }

    
Home | Imprint | This part of the site doesn't use cookies.