Attribute and Sorting

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
User avatar
aimeos
Administrator
Posts: 3207
Joined: 01 Jan 1970, 00:00

Re: Attribute and Sorting

Post by aimeos » 03 Sep 2015, 08:13

Metalics wrote: To display the current sub-categories in product list page, i followed your method and added a new subpart with name Submenu. (catalog/list/submenu)

- I added a new folder with name Submenu inside /client/html/src/Client/Html/Catalog/List
- I edited the Default.php file in this directory as: private $_subPartNames = array( 'head', 'submenu', 'quote', 'promo', 'pagination', 'items', 'pagination' );
- I added a Default.php file in the new "Submenu" folder and added your code > You can see HERE
- I added 2 files in /client/html/layouts/catalog/list with name submenu-body-default.html and submenu-header-default.html. You can see submenu-header-default.html HERE and submenu-body-default.html HERE submenu-body-default.html file HERE.

But i still can not see current subcategories in catalog list page. Am i missing anything? Can you please advice?
The only thing that is wrong is the naming of the view parameter. It's different in the class and in the template. Please change it in your _setViewParams() method to "submenuItems" so it matches what the view expects.

Furthermore, you should move your new files to your own extension. Otherwise, they will be removed and you will loose them after the next update. Adding the new subpart can be done via configuration. How to create an extension for TYPO3 can be found in this article: https://aimeos.org/docs/TYPO3/Extend_Aimeos

User avatar
Metalics
Posts: 60
Joined: 13 Jul 2015, 23:59
Location: Izmir

Re: Attribute and Sorting

Post by Metalics » 03 Sep 2015, 14:44

I changed the view parameter in _setViewParams() method to "submenuItems" but still nothing:

protected function _setViewParams( MW_View_Interface $view, array &$tags = array(), &$expire = null )
{
if( !isset( $this->_cache ) )
{
$controller = Controller_Frontend_Factory::createController( $this->_getContext(), 'catalog' );

$view->submenuItems = $controller->getCatalogTree( $view->param( 'f_catid' ), array( 'text', 'media' ), MW_Tree_Manager_Abstract::LEVEL_LIST );

$this->_cache = $view;
}

return $this->_cache;
}

I am sorry if im boring you by insisting on that but we are building a really large website and we will need 1 level down subcategory links in a category.

User avatar
aimeos
Administrator
Posts: 3207
Joined: 01 Jan 1970, 00:00

Re: Attribute and Sorting

Post by aimeos » 04 Sep 2015, 08:29

Metalics wrote:I changed the view parameter in _setViewParams() method to "submenuItems" but still nothing:

Code: Select all

$view->[b]submenuItems [/b]= $controller->getCatalogTree( $view->param( 'f_catid' ), array( 'text', 'media' ), MW_Tree_Manager_Abstract::LEVEL_LIST );
Is the "f_catid" parameter part of the URL? You should add some debug code to your methods to see if they are called and what's the result of the getCatalogTree() method.

Post Reply