I have a category called "Price" in my main navigation which has every product in the system assigned to it. The main point of the category is when you view it you can use the price filter on the layered navigation to filter any product on the site by price.
What I would like to do is output the price filter as a sub menu on the main navigation so a user could see a drop down of the different price bands and press one and be taken to the category with the filter already set.
I had a plan to edit this function Mage_Catalog_Block_Navigation::_renderCategoryMenuItemHtml() and output this function Mage_Catalog_Model_Layer_Filter_Abstract::getItems() if the category was called "Price" but I cant see a way to get the filters to out put from the category i pass it.
Has anyone done something like this before that could point me in the right direction?
if i was you i'd be tempted to change the plan a bit.
magento menus can be avoided. you can create you category and render a custom block for a price based filter.
if you extend Mage_Catalog_Block_Layer_Filter_Price you can set your category and get most of the info.
probably the best thing might actually just be to build a little slider. it only has to go from the most expensive to cheapest price, or zero and then load the category list with price apllied.
Related
On my product view page, I'm outputting the product price in a couple of places using the getPrice and getSpecialPrice methods.
Selecting a product option on a configurable product won't update these prices at the front end though, which saddens me.
Can anyone tell me how I do about making these values update when we select an option from the dropdown?
I would recommend that you do two separate methods binding them to a checklist box, one with the product price only (so that if the user selects it, it displays the face value of the product price) and the other one with example *x10% so that when the person checks it the product price will be decreased by 10% and store the temp new value so that you don't have it hard-coded.
Hope you get what I mean, my English is not so good
You should learn something about Servlets coupled with ajax.
Hope you can help Magento users,
I have a clothing store selling big mens clothing. One of my best categories in my old store was allowing the customer to view all the products in his size in one feed. Whilst I am aware they can choose the top level category (menswear) and use the attributes down the left side to select their own size, I would like to have a specific category for instance (All 3xl products) all ready setup in the mega menu. So far I have been able to set a category up and set a url rewrite to the required url attribute. Works fine but I can not add text at the top of the page (for seo purposes).
I was considering if it is possible to create a static block with only 3xl products in, then I can design the page around the static block?
Depending upon category structure if you are using anchor categories you could create a link directly to an attribute filter.
i.e
I have an attribute called material
and the value of polycarbonate id is "4"
you can append the values of layered navigation/anchor categories to the end of the url
mysite.com/vehicles.html?material=4
Say for example, you have an attribute of "size", with the id of 3xl = "10"
and mens was your anchor category. It would look like
yoursite.com/mens.html?size=10
Then you would just create a simple html link to http://yoursite.com/mens.html?size=10
I have several configurable products (with many simple products associated to them).
When browsing the super attributes through the layered navigation, you can filter down to all products that have (for instance) size= medium, Colour = Red.
I have set my simple products to not be visible and showing my configurable products, however, when you select the configurable product, the product options do not default to what has been filtered in the layered navigation.
Is there a way to get the relevant product options pre-selected on the product page?
suppose the user selected the filters from the listing page as size ="medium" colour ="red"
Now when user selects the configurable product from listing page after applying filter corresponding values must be pre selected on product detail page.
There is no ready-made way to do this. When the request is made for the product that product knows nothing of the layered navigation state. In theory you could add in some server side code to do that however this might have a performance penalty as you might not be able to use cache effectively.
You could do something on the front end in javascript. Add an event listener to the links in the filtered navigation and store an object in local storage, e.g. with size and colour.
On the product page you could then set the configurable product according to those values by waiting for the configurable product options to be built, then load the options object from local storage and then update the configurable product accordingly. You will need to then fire off events so the product page knows that options have been selected and can do things like update the price accordingly.
Internally Magento uses attribute option values that have numerical ids. These can be a bit complicated to work with, so you may want to put some logic in to read the labels instead, e.g. 'Red' instead of e.g. '461'.
There is no prototype specific way of working with local storage and you don't need some layer of jquery, normal javascript should suffice when it comes to storing/retrieving your size/colour object.
I found the following article to be the head start needed for doing things with the configurable product drop-downs:
http://inchoo.net/ecommerce/magento/how-to-make-configurable-options-autoselected-on-configurable-product-view-page/
I'm trying to solve a problem with the top navigation in Magento.
The top navigation I have, currently shows a top level category and it's sub categories. What I want to do is add another level underneath each sub category containing brands in that sub category as shown here (http://cl.ly/image/3A3D1i1D3j3x)
I want the brand items to be retrieved from the "brands" attribute of products in the parent sub category (Jackets etc.) rather than creating a bunch of brand sub categories in each product type sub category as that is a nightmare for administrating the system.
If anyone knows of a good extension free or paid that does this, I'm willing to go down that route too.
Thanks for the help.
I'm working on something similar right now. It's not an exact fit as it wouldn't integrate with your menu but I would recommend using Amasty's Improved Layered Navigation for this.
It allows you to add a horizontal layered navigation block and set it up so that you can filter by brand based on an attribute. You could use the default manufacturer attribute but I've found it less problematic to add a new one called Brands. The module allows you to assign images to attribute values, so you can have all the logos for your brands listed and the user can filter the products by clicking on the logo.
You can also then use the same brand images in the product list page and the product view page.
This is very easy for your client to manage, they just assign the product it's brand attribute when they create it.
Here's a screenshot of the site I'm working on so far (still not finished so some rough edges) so you can see what I mean. Just a few test products in there and I have used the vertical block rather than the horizontal one but you get the idea. The user just clicks on a logo to filter the list.
And apart from that there's lots of other handy aspects to the module, including sliders for filtering other attributes (weight, price and anything numeric).
I have 2 new custom productattributes that enables or disables a product in the category list and product-detail page.Both are dates.
need to calculate if the current date is between the 2 custom dates.
if it is, the product must be enabled.
I can't find a place in the code to enable/disable a product in the category list and detail page. I don't want to fix this in a phtml.
Can somebody help me?
You have to modify two things :
the product collection in order to add the filtering on your two news attributes.. For that, for example, you can implement the event catalog_block_product_list_collection from Mage_Catalog_Block_Product_List (used in product listing and search) where you'll add your filtering with the function $collection->addAttributeToFilter('attribute_code', $condition)
the product page itself. You can add your logic in order to display or not your product by multiple ways.. I would choose to implement the event catalog_product_is_salable_after in order to add your logic here and call $product->isSalable() in the template or controller...