No left navigation with categories - magento

I have a big trouble with displaying the left navigation sidebar with product categories.
My category tree looks like
Default category (Is active = Yes, include in navigation menu = Yes, Is anchor = No)
Category (Is active = Yes, include in navigation menu = Yes, Is anchor = Yes)
Category 1 (Is active = Yes, include in navigation menu = Yes, Is anchor = Yes)
Category 2 (Is active = Yes, include in navigation menu = Yes, Is anchor = Yes)
Brand (Is active = Yes, include in navigation menu = Yes, Is anchor = No)
Brand 1 (Is active = Yes, include in navigation menu = Yes, Is anchor = No)
Brand 2 (Is active = Yes, include in navigation menu = Yes, Is anchor = No)
I have products
Product 1 assigned to Category and Category 2.
I have set in System > Manage stores, the Root Category option set to Default Category for all stores.
I didn't make any changes in templates.
Breadcrumbs are correct. I can see the product in Category and Category 2, but if I'm in the Category listing I can't see the subcategories listing, so I can't see the Category 2.
What's the problem here?

When the Category has the Attribute "isAnchor" set to true there wont be a list of subcategories, instead you get the layerednavigation. Set the "isAnchor" to "No" to get a list of subcategories.

Related

SAPUI5 Panels - Controlling position of content

I have a number of Panels which, when expanded, show the corresponding questions for that particular 'Category'
The issue I have is, say for example I answer the questions for the 1st panel, the content will scroll down, eventually hiding the panel... fair enough.
However, when I click on the Next Category (Production Area), I need to the page to scroll back up to the first question in the Category, or maybe even just display the selected category at the top of the page.
Is this possible?
Currently, the user has to continually scroll back if when they select the next Category.
You can achieve it using scrollToElement()
var oPage = sap.ui.getCore().byId("pageId"); // you page ID
var oList = sap.ui.getCore().byId("ListId"); // element ID to which it has to scroll
if (oPage && oList) oPage.scrollToElement(oList, 1000);
Execute the above code inside the panel event expand.
you can try to use this control instead which suits your needs
https://sapui5.hana.ondemand.com/#/entity/sap.uxap.ObjectPageLayout
After trying everything, this is what worked for me.
onExpand: function (oEvent) {
if (oEvent.getParameters().expand) {
var focusID = oEvent.getParameter("id");
var elmnt = sap.ui.getCore().byId(focusID);
elmnt.getDomRef().scrollIntoView(true);

E4 RCP How to set selection of ToolBarItem that contains Radio Buttons

In Eclipse E4 (Luna), using the application model to create parts, handlers, commands, handled menu items etc, (these are not created programatically). I have a toolbar. This contains a sub-Menu item called "Filter" that contains another sub-menu of two filters. The two filters are two Handled Menu Items which are set up as "Radio" Buttons.
When I select the appropriate in the UI of my running app from the selection, the Radio button switches just fine to the selected Item. However I would like this selection to update (deselecting one Radio button and selecting the appropriate radio button of the handled menu item) when my ViewPart changes through other UI selection. Currently my ViewPart updates, but the Radio buttons are on the same previous selection through the UI.
Is there a way in which I get access both Handled Menu Item's IDs and set the selection (one to false, the other to true) when the viewer is updated.
Image of design is attached below:
Hierarchy of the application model is as follows:
Thanks in advance,
Marv
You can use the model service to find menu items. Use something like:
#Inject
EModelService modelService;
#Inject
MApplication app;
List<MMenuItem> items = modelService.findElements(app, "menu item id", MMenuItem.class, Collections.emptyList(), EModelService.IN_MAIN_MENU);
Once you have the MMenuItem you can call the setSelected(boolean) method to change the selection.
To find a menu item which is in a Part menu use:
modelService.findElements(app, "menu item id", MMenuItem.class, Collections.emptyList(), EModelService.IN_PART);
(IN_PART argument instead of IN_MAIN_MENU).
You could also specify the MPart rather than the Application as the first argument to findElements which may speed up the search.
For menus as a child of a Tool Bar Item it appears that the model services cannot find these directly. However you can find the Tool Bar Item and look at the menu yourself:
List<MToolItem> items = modelService.findElements(app, "tool bar item id", MToolItem.class, Collections.emptyList(), EModelService.IN_PART);
MToolItem item = items.get(0);
MMenu menu = item.getMenu();
List<MMenuElement> children = menu.getChildren();
... search menu elements
I solved this by starting with MPart PartID and drilling down to the HandledMenuItems on which I wanted to set the Radio Button selections, then setting the selection property for each individual HandledMenuItem.
This can probably be refactored to be more concise, but I've left the code with each step to have the solution easier to read.
BTW, in every instance / combination of the EModelService methods, the list returned a size of 0. So I'm not certain if that will work for what I'm trying to achieve. The following does work, although I'm not certain it is the most efficient means.
I hope this helps others.
// Get view part
MPart viewPart = _partService.findPart("part_id");
// get list of all menu items from the Part
List<MMenu> viewPartMenu = viewPart.getMenus();
// Get list of ViewMenus from viewPartMenu there is only one View Menu so it will be index 0
MMenu viewMenu = viewPartMenu .get(0);
// Get list of MMenuElements from the viewMenu - the children in the view menu
List<MMenuElement> viewMenuElements = viewMenu.getChildren();
// This gets me to the 2 HandledMenuItems
// Upper Most HandledMenuItem Radio Button is at viewMenuElements index 0. This is cast to MHandledMenuItem
MHandledMenuItem upperHandledMenuItem = (MHandledMenuItem) viewMenuElements.get(0);
// Set Selection
upperHandledMenuItem.setSelected(false);
// Lower Most HandledMenuItem Radio Button is at viewMenuElements index 1. This is cast to MHandledMenuItem
MHandledMenuItem lowerHandledMenuItem = (MHandledMenuItem) viewMenuElements.get(1);
// Set selection
lowerHandledMenuItem.setSelected(true);

Magento: Changing the number of product column in different category

There are a few answers posted out there but non of them works for me.
So what I want to achieve is on Category A I am showing 4 columns per row with left sidebar, and on Category B I want to create 5 columns with no sidebar at all.
What I have tried:
1) Edit Category B Custom Design Tab Page Layout to 1 Column, In Custom Layout Update add the following code:
<reference name="product_list">
<action method="setColumnCount"><columns>5</columns></action>
</reference>
Cleared cache and nothing changes, Category B is still 4 columns.
2) Create CMS Pages with 1 column layout and use this code
{{block type="catalog/product_list" category_id="22" columnCount="5" template="catalog/product/list.phtml"}}
Products show up but its still 4 columns.
3) Checked the CSS width is set to a number high enough to be able to display the number of items per row, so that it doesn't push down overflowing items.
Non of the above works. Also in the code its showing two rows of
<ul><li>1,2,3,4</li></ul>
<ul><li>1,2,3,4<li></ul>
instead of showing
<ul><li>1,2,3,4,5</li></ul>
so its not CSS issue.
update
I've this code in my list.phtml, do I add an addtional $_columnCount == 5 for this to work?
`
$_columnCount = $this->getColumnCount();
if($_columnCount == 4){
$imgSize = 180;
}elseif($_columnCount == 3){
$imgSize = 245;
}
?>
Try with column_count="5" instead of columnCount="5". And make sure the list template you are using has no hard coded values and makes use of getColumnCount()

Magento: using categories for brands

I'm starting to build a new Magento site and its primarily focused on clothing brands. Launching with around 25 each one providing a range of products in categories. so some will have everything from shoes to jumpers, some may just be shoes or accessories.
Users need to be able to view a brand and see its categories for products, as well as via a different view view all of a type of product category so all shoes.
I really don't know how to set this kind of thing up. I know i could use categories for the brands then sub categories for the clothing categories, but then i don't know how linking sub categories items together would work (I've viewing all jumpers across all brands if they have separate parent categories).
Here'show the structure needs to work
Brand_1{
Shoes{
Item 1,
Item 2
}
Coats{
Item 3
}
},
Brand 2{
Shoes{
Item 4,
Item 5,
Item 6
}
Jumpers{
Item 7,
Item 8,
Item 9
}
Accessories{
Item 10
}
Shirts{
Item 11
}
},
Brand 3{
Shoes{
Item 12,
Item 13,
Item 14
}
}
So users can view brand 1 page, see items 1-3. Or view brand 1>Shoes and see items 1-2. Or view Shoes and see items 1,2,4,5,6,12,13,14.
The way I chose to work this out was to create a custom attribute as a brand drop down to assign a brand to every item. Then I chose to create a custom admin module with a database table to store the brand details giving the ability to store extra information for each brand, that feeds into the attribute dropdown.

How to dynamically load carousel items in Sencha

I have a problem with my product view. I want to display product data. each product is a "box" with an image and text. I want to display six products on a panel. As of the fact that i have many products i want to have a "carousel like view". My idea was the following: Place 6 products on a panel. Load 3 panels and place each panel as a carousel item so that i can swipe to get to another "page".
To save performance I tried to always have only 3 items in the carousel. The active "page" and the page before, and the page after, so that I can swipe to left/right and the next page can be loaded.
I tried to put my logic in the "onActiveItemChange"-Listener of the carousel, but I had massive problems with adding/removing carousel items. So my Question is is it possible to do what i want to accomplish?
Is there a better alternative? Of course my data is in a store, but I don't want that standard list view.
Another Question: Because my first attempt with the carousel failed i tried to build a Ext.Container (card layout) with the panels on it. But how can I listen to a swipe event on a Panel???
thanks for help ;-)
Even I am doing the same, using carousel & a store. Every page of carousel is a view(panel) which would have 4/6 child views(panels). On store load I am creating those children and then divide them into pages and add those pages to carousel.
This is working fine for me and on activeItemChange I am loading more pages:
activeitemchange: function(container, value, oldValue, eOpts) {
var activeItemIndex = container.getActiveIndex();
var galleryTotal = container.getInnerItems() ? container.getInnerItems().length : 0;
if ((activeItemIndex + 1 == galleryTotal)) {
console.log("At last page, time to load");
var store = this.config.store;
store.nextPage({ addRecords: true });
}
}
I think I understand your issue. Assuming you've got 3 items and you're always viewing the middle one (as you move forward, item 0 gets destroyed and one item gets created). And assuming that each item has an id associated with its location in the list.
var current_item = Ext.getCmp('carousel_name').getActiveItem().getId();
current_item = Number(current_item.replace('item', ''));
//Objects to create
var next_item = current_item + 1;
var previous_item = current_item - 1;
//Objects to destroy
var next2_item = current_item + 2;
var previous2_item = current_item - 2;
//Create items
var createItem = function(item_location, type){
var carousel_item = create_content(item_location);
if(type == 'next'){
Ext.getCmp('carousel_name').add(carousel_item);
}else if(type == 'previous'){
Ext.getCmp('carousel_name').insert(0, carousel_item);
Ext.getCmp('carousel_name').setActiveItem(1);
}
}
createItem(next_item,'next');
createItem(previous_item,'previous');
//Destroy items
if(Ext.getCmp('item'+previous2_item)){
Ext.getCmp('carousel_name').getItems().items[0].destroy();//This is a hack, for some reason with the above commented out line, the item was getting destroyed but wasn't being removed from carousel_name
}
if(Ext.getCmp('item'+next2_item)){
Ext.getCmp('carousel_name').getItems().items[Ext.getCmp('carousel_name').getMaxItemIndex()].destroy();//This is a hack, consistency with previous destroy (above)
}

Resources