/** * @param $number * @param \Shopware\Models\Category\Category $category * @param ProductContext $context * @param array $data * @return array */ protected function getProduct($number, ProductContext $context, Category $category = null, $data = array('inStock' => 0, 'minPurchase' => 1)) { $product = parent::getProduct($number, $context, $category); $product['lastStock'] = true; $product['mainDetail'] = array_merge($product['mainDetail'], $data); return $product; }
protected function getProduct($number, ProductContext $context, Category $category = null) { $product = parent::getProduct($number, $context, $category); $configurator = $this->helper->getConfigurator($context->getCurrentCustomerGroup(), $number, array('Farbe' => array('rot', 'blau', 'grün'), 'Größe' => array('L', 'M', 'S'), 'Form' => array('rund', 'eckig', 'oval'))); $product = array_merge($product, $configurator); return $product; }
/** * @param $number * @param \Shopware\Models\Category\Category $category * @param Supplier $manufacturer * @param ProductContext $context * @return array */ protected function getProduct($number, ProductContext $context, Category $category = null, Supplier $manufacturer = null) { $product = parent::getProduct($number, $context, $category); if ($manufacturer) { $product['supplierId'] = $manufacturer->getId(); } return $product; }
protected function getProduct($number, ProductContext $context, Category $category = null, $imageCount) { $data = parent::getProduct($number, $context, $category); $data['images'][] = $this->helper->getImageData('sasse-korn.jpg', array('main' => 1)); for ($i = 0; $i < $imageCount - 2; $i++) { $data['images'][] = $this->helper->getImageData(); } return $data; }
/** * @param $number * @param ProductContext $context * @param \Shopware\Models\Category\Category $category * @param array $prices * @return array */ protected function getProduct($number, ProductContext $context, Category $category = null, $prices = array()) { $product = parent::getProduct($number, $context, $category); if (!empty($prices)) { $product['mainDetail']['prices'] = array(); foreach ($prices as $key => $price) { $product['mainDetail']['prices'] = array_merge($product['mainDetail']['prices'], $this->helper->getGraduatedPrices($key, $price)); } } return $product; }
/** * @param $number * @param \Shopware\Models\Category\Category $category * @param ProductContext $context * @param $prices * @return array */ protected function getProduct($number, ProductContext $context, Category $category = null, $prices = array()) { $product = parent::getProduct($number, $context, $category); $product['mainDetail']['prices'] = array(); foreach ($prices as $key => $price) { if ($key === $context->getCurrentCustomerGroup()->getKey()) { $customerGroup = $context->getCurrentCustomerGroup()->getKey(); } else { $customerGroup = $context->getFallbackCustomerGroup()->getKey(); } $product['mainDetail']['prices'][] = array('from' => 1, 'to' => 'beliebig', 'price' => $price, 'customerGroupKey' => $customerGroup); } return $product; }
/** * @param $number * @param ProductContext $context * @param \Shopware\Models\Category\Category $category * @return Article */ protected function getProduct($number, ProductContext $context, Category $category = null) { $product = parent::getProduct($number, $context, $category); $product['downloads'] = array(array('name' => 'first-download', 'size' => 100, 'file' => '/var/www/first.txt', 'attribute' => array('id' => 20000)), array('name' => 'second-download', 'size' => 200, 'file' => '/var/www/second.txt', 'attribute' => array('id' => 20000))); return $product; }
protected function getProduct($number, ProductContext $context, Category $category = null) { $data = parent::getProduct($number, $context, $category); return $this->helper->createArticle($data); }
/** * @param $number * @param \Shopware\Models\Category\Category $category * @param ProductContext $context * @param bool $shippingFree * @return array */ protected function getProduct($number, ProductContext $context, Category $category = null, $shippingFree = true) { $product = parent::getProduct($number, $context, $category); $product['mainDetail']['shippingFree'] = $shippingFree; return $product; }
/** * @param $number * @param ProductContext $context * @param Category $category * @param $name * @return array */ protected function getProduct($number, ProductContext $context, Category $category = null, $name) { $product = parent::getProduct($number, $context, $category); $product['name'] = $name; return $product; }
protected function getProduct($number, ProductContext $context, Category $category = null, $additionally) { return parent::getProduct($number, $context, $additionally); }
protected function getProduct($number, ProductContext $context, Category $category = null, $properties = array()) { $product = parent::getProduct($number, $context, $category); $product = array_merge($product, $properties); return $product; }
protected function getProduct($number, ProductContext $context, Category $category = null, $attribute = array('attr1' => 10)) { $product = parent::getProduct($number, $context, $category); $product['mainDetail']['attribute'] = $attribute; return $product; }
protected function getProduct($number, ProductContext $context, Category $category = null, $releaseDate = null) { $product = parent::getProduct($number, $context, $category); $product['added'] = $releaseDate; return $product; }
protected function getProduct($number, ProductContext $context, Category $category = null) { $data = parent::getProduct($number, $context, $category); $data['mainDetail']['prices'] = array_merge($data['mainDetail']['prices'], $this->helper->getGraduatedPrices($context->getFallbackCustomerGroup()->getKey(), -20)); return $data; }