Magento - Populate a dropdown from 'X' Store categories - php

I am in the process of customising our search filters on our Multi-Domain Magento install and was wondering how I can populate a dropdown with the category titles from a store depending on what store/domain you are on.
Probably a simple query but have so much going on at the moment I can't think where to start!
Thanks

Once you have specified your store (probably using a switch based upon the domain) you should be able to get a collection of the categories associated with that store id.

Related

MySQL Organisation Strategy for Multi-user with 100% customization

My question today is how should I organize my MySQL Table to get a 100% customized menu for my different users...
Let me explain: I will have a large menu tree (like windows) that will display Categories & Items for the user. I want the user to be able to delete, add or Modify anything like: Category name, Delete category, Add item, Change item name and Delete Item.
BUT: I want to offer my different clients a starting "Base" menu with common Items and Categories when they register, but when a user modifies the category (ex: change name or delete it), I don't want his changes to interfere with the other user's Menu..
So, how should I organize my DB to handle this: at this moment, I have 2 Tables: T_categories(with parent info to structure for the tree menu) & T_items (with category_id) but I realize that I don't really know how I will be handling my queries to enable "delete or rename" for Categories and Items... Should I make unlimited tables like this??
T_user1_categories & T_user1_items
T_user2_categories & T_user2_items
and so on, but if I have 1000 users it'll not be cool =/
At this time I can only(i think) create customized items with ex: privateview_id (user id)
Also, if I build something that, when I rename a category, it create a new category with a privateview_ID, all the items that were already in it will lose their position
I'm using PHP and MySQL
If you have an idea, i will be happy to hear it!!
Thank-you!
Raphael
A menu bar is a hierarchical thing. I suggest you "build" that things using a hierarchical meta data like XML.
You can store your users, categories and items in respective tables and also create a menus table to store the menus users created.
You ill still be able to do relations between users, menus, categories and items creating relational tables.
Also a user can just move a item from a category for another, not changing your usersXcategories or usersXitems relations but just changing the XML.
I cannot say more without knowing more details but your requirements.
Well, finally i've come to conclusion that the best way will be to create a table for every users... I've read that some people have MySql databases with over 1000+ tables without any problem and going the other way would be a lot of trouble. Also, I don't plan on having 1000+ users because that custom menu is part of a "paying" option. Thank-you for your answer jean

Joomla K2 - Displaying an item's extra field data elsewhere on the site

i'm building a website for a house builder and each house plot (k2 item) has a few extra fields associated with it such as 'price' and 'availability'.
i would like to display this extra field data elsewhere on the site perhaps in a table that lists 5-6 plots and displays their current price and availability.
the idea is to be able to change the price of a house in the extra fields section and then have this change reflected in other parts of the site that call on this extra field data.
i've read this article..
http://jurawa.com/notes/item/27-update-making-k2-more-like-a-true-cck-custom-admin-templates-and-calling-specific-extra-field-data
..which explains a process of displaying extra field data but i've not managed to get this to work. i also think that this method would only work if displaying extra field data while already inside the item that it relates to. i'm trying to display this extra field data around other parts of the site.
i'm trying to replicate something like the table that appears on this page (just above the map)
http://www.orionhomes.co.uk/development/brunswick-place
running the latest version of jooma and k2 and have full access to server and database.
hope someone can help..!
many thanks
I have used the Raxo All-In-One module to accomplish this in the past:
http://www.raxo.org/raxo-all-mode-k2.html
This, along with ability to insert a module in an article, would allow you to place the specific K2 content/fields wherever you need them and have them updated dynamically by K2.
Another option would be to create a new template for K2 and only output the extra fields in your item list. This would allow you to create the table view you are looking for.
There is a great plug-in for Joomla/K2 that does this for you at:
http://joomcar.net
It's called K2 Filter and Search Module and it will display a table with the extra fields as you have demonstrated in at:
http://www.orionhomes.co.uk/development/brunswick-place
You can definitely display those extra fields wherever you need them on the site.
This step-by-step tutorial may help you to create the extra fields.
Then you just need to enable the extra fields in your view and modify your template.

Drupal route based node content

I'm new to Drupal and have a basic question which I cannot find a good answer to. I am trying to dynamicly determine the contents of my website based on a selection made by the user and keep the selection displayed in the routing for SEO purposes.
It's a website for a Restaurant with multiple franchises.
What i'm trying to do is the following:
The user visits my website and gets a splash screen presented with the available franchises or a textbox to enter his postalcode
Upon selecting he enters the main website with the navigational structure adapted to the selected franchise. For example: domain.com/city/, domain.com/city/menu, domain.com/city/menu/dishes, domain.com/city/contact, ...
The contents of all nodes are based upon the city the user selected. Some franchises have extra nodes which should be displayed in the main navigation aswell.
What I have thought about so far is to try to accomplish this with taxonomy but I really have no idea where to start. Parts of the nodes will be the same for all franchises other parts will be different. Menu item prices will also be different.
This is the first website i'm building using Drupal so any advice is welcome.
Thanks!
It will be impossible to explain it all here but yes it is possible to select your content based on user input in Drupal. You will need to look into Views & Panels.
In Views you can use arguments to narrow to a specific taxonomy. With Panels , an argument can be retrieved fron the URL and passed to the Views in order to display the results.
There are a lot of resources available, Merlin of Chaos, the author of the Views & Panels modules has written a book about it. There are video tutorials online. Your best bet is to start with drupal.org.

Modx custom tv with multiple inputs

I need to build a custom tv in modx that will all a user to select a image, a title and a date.
Can't seem to find any help other than the docs with although detailed don't answer my problem.
Anyone done this before and are able to advise me further
Cheers
I'm not 100% sure, if this is what you're trying to archieve, but I think multiItemsGridTv (MIGX) for modX revolution is what you want.
From the docs:
MIGX (multiItemsGridTv for modx) is a custom-tv-input-type for adding
multiple items into one TV-value and a snippet for listing this items
on your frontend.
It has a configurable grid and a configurable tabbed
editor-window to add and edit items. Each item can have multiple
fields.
For each field you can use another tv-input-type.
Essentially, you can make up a set of multiple different template variables (including images), that always belong together. If you then assign your MIGX tv to a template, you can enter as much of these sets as needed per resource.
You can download it via package management or from the modX Extras Repository.

Magento - Multi-domain & Filters

We're looking to build in a filter to our Magento site with drop down choices for the first two options, a selection box for price plus a colour chooser.
Firstly how easy is it to fetch the info for the first two dropdowns from the database so the first box is populated with the first category then the second box populated with the choices for that particular category? (and then change if someone changes the first selection)
Secondly how easy is it to set up a separate filter for each site so it only fetches info for the corresponding store and doesn't show products from other stores?
The filter will only have to show the products when you press a 'find' button so I guess it's a case of building up the search query?
Thoughts and ideas on this would be great, only been working with Magento for a month so still not sure of it's full capabilities.
Thanks
For the second part Magento already shows only products relevant to a given store. When you set up the stores (in System > Store Management) you have the option of giving it a unique "root category". Creating root categories is easy, in Catalog > Manage Categories.
The first part requires some programming work. From your previous questions it looks like you have a good understanding of Javascript so AJAX is not a problem. I don't know how familiar you might be with PHP, listing products will require you create a new module, with it's own controller, that forms a collection from the selected category. Collections make their own queries so you don't need to write a lick of SQL, and they have functions for exporting as JSON or XML so you don't need to write that either. For an experienced programmer it would take almost no time at all.

Categories