コード例 #1
0
 protected function createProduct($number, ProductContext $context, Category $category, $additionally)
 {
     if ($additionally['createVariants'] == true) {
         $fourth = $this->getProduct('fourth', $context, $category);
         $configurator = $this->helper->getConfigurator($context->getCurrentCustomerGroup(), 'fourth');
         $fourth = array_merge($fourth, $configurator);
         foreach ($fourth['variants'] as &$variant) {
             $variant['inStock'] = 4;
             $variant['minPurchase'] = 3;
         }
         return $this->helper->createArticle($fourth);
     } else {
         return parent::createProduct($number, $context, $category, $additionally);
     }
 }
コード例 #2
0
 protected function createProduct($number, ProductContext $context, Category $category, $additionally)
 {
     $article = parent::createProduct($number, $context, $category, $additionally);
     $this->helper->createVotes($article->getId(), $additionally);
     return $article;
 }
コード例 #3
0
 protected function createProduct($number, ProductContext $context, Category $category, $sales)
 {
     $article = parent::createProduct($number, $context, $category, $sales);
     Shopware()->Db()->query("UPDATE s_articles_top_seller_ro SET sales = ?\n             WHERE article_id = ?", array($sales, $article->getId()));
     return $article;
 }