public function categoryExportAction() { $parent = Object_ProductCategory::getById(11148); $entries = array(); $this->exportChildren($parent, $entries); echo "<pre>"; foreach ($entries as $entry) { echo '"' . implode('";"', $entry) . '"' . "\n"; } echo "</pre>"; die; }
/** * show product detail page * @throws Zend_Controller_Router_Exception */ public function detailAction() { $this->enableLayout(); // load product $product = Website_DefaultProduct::getById($this->getParam("product")); if (!$product || !$product->isActive()) { throw new Zend_Controller_Router_Exception("die gewünschte Seite existiert nicht mehr"); } $this->view->product = $product; $category = Object_ProductCategory::getById($this->getParam("category")); // recently viewed products $recently = new Website_OnlineShop_Demo_OnlineShop_RecentlyViewedProducts(OnlineShop_Framework_Factory::getInstance()->getEnvironment(), function ($id) { return Website_DefaultProduct::getById($id); }); $sizeVariants = $product->getSizeVariants(); if (empty($sizeVariants)) { $linkProduct = $product; } else { $linkProduct = array_shift(array_values($sizeVariants)); } $this->view->recentlyViewed = $recently->addProduct($linkProduct)->getProducts(4); $filterdefinition = null; if ($category) { $filterdefinition = $category->getFilterdefinition(); } if (empty($filterdefinition)) { $filterdefinition = Pimcore_Config::getWebsiteConfig()->fallbackFilterdefinition; } $this->view->similarProducts = $this->getSimilarProducts($product, $filterdefinition); }
<?php // init $values = $this->values; // resort values $valuesIndex = array(); foreach ($this->values as $entry) { $valuesIndex[$entry['value']] = $entry['count']; } // category to show if ($this->currentValue) { $current = Object_ProductCategory::getById($this->currentValue); } ?> <div class="filterSection gradient js_filterparent" id="filter-categories"> <h4 class="title"><?php echo $this->translate("general.filters." . $this->label); ?> </h4> <?php if ($current) { ?> <input type="hidden" name="parentCategoryIds" value="<?php echo $current->getId(); ?> " /> <?php } ?> <?php