How to query a menu table params value in Joomla? - joomla

First of all I'm using the K2 component and my Menu Item Type is set to categories (itemlist).
Now I have the K2Filter search module which I using to search by categories. But when it displays the category searched, it doesn't change the Itemid. So I trying to get it to do that.
Luckily, the module does get the category id (of course).
So I'm trying to add a bit of code that will use the category id to query the menu table to find the proper menu id in order to set the Itemid to the correct value.
The only catch is that the category id is stored in the params of the menu item. Which looks like this:
"categories":["24"],"singleCatOrdering":"","menu-anchor_title":"",etc...
SO I was thinking, I'll get category variable, then use it to query the menu table and get the id. But I can't seem to pull the value of the catagories in the params.
SELECT id FROM #__menu where $the_params_categories_value= $catid;
Maybe I'm going about this wrong, I really open to suggestion. Anyone?

Related

how to add bulk category assign option in update product attribute Magento

HI i need to assign multiple products a same categories. I have check that under update product attributes in admin but unfortunately there is no option for this. There.
Can any body suggest me how can i add that functionality in admin.
please check this screen-shot
http://awesomescreenshot.com/0a92v48t1b
http://awesomescreenshot.com/09a2v4id8c
"i need to assign multiple products a same categories."
If you want to do this. you have to go to category edit.
Catalog -> Manage Categories
Select a category
Click on Category Products tab (on top)
On very first column select any (there you see Yes, No and Any option)
Click on Search. You will see list of products.
Select products to assign to that category.
I recently wanted to bulk change / replace the category of products (with or without an existing category) to a new category "Expired". I created a CSV with the following fields:
sku,_store,_category
194337,,Expired
106025,,Expired
I then used System > Import and for Import Behaviour selected "Replace existing complex data". Select your csv file and away you go. Remember a re-index is required.
If you wish to wanted to bulk add a first or further category to products, create the same file as above but for Import Behaviour select "Append complex data". I.e. if a product had been in Category: "TVs" and you use "Append complex data" with the above file, it would now be in both Categories: "TVs" and "Expired".

I want to create a category just to show products in a particular attribute

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

How to add custom options to Product Sort By drop down in Magento?

I have developed my first Magento site and my client has asked me to do something I cannot
figure out how to do.
Currently, in any given category, the product Sort By dropdown contains the following options:
Position
Name
Price
I need to change that to:
Relevance
Popular
Price
How do I do this?
This is all to do with your attributes. Say you have an attribute in
Admin>Catalog>Attributes>Manage Attributes>[attribute like: 'name' etc>Properties>Frontend Properties>"Used for sorting in product listing".
you need to select Yes. Then once you have selected Yes in the attributes you want to sort by, go into
Admin>Catalog>Manage Categories>[Select your category you are displaying the drop down in]>Display Settings tab,
then select the Attributes you want to be sorted by in the Available Product Listing Sort By list. If the box is greyed out, untick the Use All Available Attributes checkbox. You may need to hold Ctrl and click on the attributes to select multiple values. Then Save.
Done
Looks like the product type with drop-down is Configurable Product. You can see these three options,
Position
Name
Price
You can locate these options under,
Catalog->Manage Products->Your_product->Associated Products->Super product attributes configuration
Also, you can directly update this into,
Relevance
Popular
Price
In case if these fields are missing, you can search for attributes named, Position||Name||Price.
You can locate the label,
Catalog->Attributes->Manage Attributes->Your_attribute->Manage Labels/Options.

Magento: Layered Navigation by Price in Main Navigation

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.

Setting ItemID of a page based on categoryID of articles

Here is the situation
I am adding some articles within a category that are not linked by a menu item ... when I use JCE to link to these articles from another article, the menu ID of the page displayed is set to the one I am linking from ... This is perfect, the breadcrumbs are working as expected and everything is fine ...
The problem is when I perform a search... when the results return, those linked articles which has no menu item comes back with no itemID
I was wondering if there's a way to modify Joomla Router to set an ItemID for the pages which has no ItemID if they match certain catID ...
I know I will be modifying the core files ... I cannot create hidden menu items because this will disturb the breadcrumbs navigation... The site has huge number of categories so creating menu item for each will be painful!
Thanks a lot for your help.
You could certainly modify the router to look up the catID for a particular article, but it would not accomplish anything unless that category has a corresponding menu item. itemID specifically comes from the itemID so there must be a menu item related to it in order for it to be a valid itemID.
You could modify your search form to pass along the current itemID, but if your search shows up on every page, it would vary depending on where the search was initiated.
If all of your content items can use the same itemID, you might want to simply use an override for your search results and add that particular itemID to all your search results.
I am afraid that there is no simple answer if you do not want to create menu items.

Resources