How do I modify the Magento Search to check child skus? - search

Currently, the site search will search all of the skus of the items marked as being visible in search. This is all well and good.
The problem arises when the customer knows a sku of the individual child item. So, let's say a product comes in both a 20 foot and 25 foot variation. We would put those into a configurable product and have a single product page where a customer could then choose which of those two lengths.
What happens is, a customer invariably knows that the sku of the 20 ft variation is RDB-20, while the other is RDB-25. A search for RDB-25 then, comes back with no results since the simple product is not visible in search - it doesn't realize there is a match.
How do I get the search to search an item with visibility "Not Visible Individually", when it's parent is visible in search?
The desired effect is that, if a child SKU is searched for, the parent should show up in the results.

There really is no good way of doing it without extending the default search, but at that point you might as well look for other options.
Here's a workaround that might be doable depending on how you manage your products and it worked for me until I moved on from the default search.
Rather than altering the search, try adding an attribute to all products and make it hidden concatenating all the skus into this field. The search should find the text attribute and show the configurable.
Its a bit of a workaround but works for me.

This is untested, but I did a bit of perusing in our attributes and I think I found something that might help.
Currently since our child products don't show up in our search, we have the parent populate with the children product's attributes.
However, things like brand, taxable amount, description, populate for every child product while our SKU does not.
The only difference I can see between the two attributes is under manage attributes -> click on attribute -> and then under properties go to frontend properties and select
Use In Search Results Layered Navigation: YES
Used in Product Listing: YES
Use In Layered Navigation: Filterable (with results)
I'm not sure which of these do what, but in the population of the fulltext search data table, somewhere it is being told to populate for the children and I believe that the admin panel is where.
I hope this helps!

Related

Orchard 1.9.1 Container Layout

I set up the following Content Definition in an Orchard 1.9.1 site:
Manufacturer
- Logo (Media Library Picker Field)
- Container (single supported type - Product)
Product
- Containable
- [Generic Fields]
I added a few sample Product items to the site, and as part of that it had me select the Member Of option, which was a list of Manufacturer items I had already added.
The issue I have is, when I try to build a query to use with a projection widget, I can't seem to find a way to get either a Manufacturer's children, or a Product's parent container since I need to display all content on a single view. There are only going to be ~20 line items here, so performance is a non-issue. If I do multiple queries (one for each type), everything shows up individually but the Shape Tracing tool, when showing me the various Model items on the view, can't seem to show me either of these options.
My end goal is building a custom view to display this information, but I can't figure out how to traverse either up the Product to what its' parent container is, or traverse down from a Manufacturer to the child Product items below it.
How do I build a query that lets me see all of this so I can build a projection widget off of that?
Edit
I played with this some more and came across the ability to take a query and attach a layout to it. That is definitely getting me closer, however the grouping option says No properties are currently available in order to group this view, however I would think being part of a container/containable would define grouping automatically. As it stands, this lets me show everything, but unfortunately the parent/child show, and then the children repeat again, independent of the parent. It's so close, but I can't quite get it right.

Need to display list of product categories

I'm exploring Nwazet.Commerce module and I've managed to replicate most of what http://nwazet.com/ does ... However I'm struggling with projection widget that displays product categorization (on nwazet.com page one to the right that has Automation, Cables & Connections, ...).
I assume these are terms for a taxonomy? How should I set projection query to get this list of terms from a single taxonomy? When I tried "Content with type CategoryTerm" it lists not just terms but also products that have them.
Thanks for any pointers.
You got it exactly right: the categories are taxonomy terms. The problem is very likely that you are displaying the terms in the projection query layout with the full detail view, where the term will display the list of items under itself. Instead, you could use a summary or a custom display type in your layout, and customize the template alternate for that display type. Alternatively, and this is how the site is set-up, you can switch to property mode for the layout and just keep it to a simple display text property with "link to the item" checked.
Some additional info: for perf, I add an eager fetch filter on Autoroute and Title part records.

Drupal views: limit results shown based on CCK field setting

I have a view that pulls in feed items (from various "Owner feeds" to use the feeds module lingo), then sorts them by date (very important). The owner feed has a CCK field for the type of feed (Twitter, Blog, etc.) and a CCK field theoretically to limit the number of feed items displayed in the view. (The reason for the limit is that Twitter dominates, but we want some blogs, etc., so I don't want to have to show 100 tweets before displaying my first blog.)
I'm guessing some sort of Views hook code is in order, but I'm not sure which one. Perhaps the hook that allows direct modification of the query...
Note that the Owner feed nid is being pulled into the view via a Relationship.
Thanks in advance!
Using the Arguments field in the view, you could first select the node type, then node post date.
In this way you could give priority to the blog type, before sorting by date.
You could also consider building two Views, for instance the top 5 blog items and the top 20 Twitter feeds...

Create a list of pages in Orchard

Lets say for example, I have a list of products that each have it's own page... in what way can I create a single page that will list each product as it's contents as a list (with hyperlinks)? Not really sure how to do this directly in Orchard - or will I need to create a custom page / widget? Thanks for any help... new to Orchard and not sure how to tackle this.
You have a couple options. I believe the Orchard gallery at orchardproject.net has a module called Simple Commerce that may solve your problem. (it's simple so it might not)
(In the following section, I've tried to boldface the terminology words that are 1) are crucial to understanding how to use Orchard and 2) helpful in finding your way around the dashboard)
Another option may be first creating a Content Type--probably one named Product with some Fields describing an individual product. Price, SKU and description come to mind, but you'll be better able to describe your own products. Each Content Type in Orchard can be associated with any combination of Parts. You may have to research which ones you actually want for an individual product, but I'd recommend:
Body (this could replace the Description I suggested above) You could include any amount of HTML/script in this section to make your individual product pages look fancy!
Common (this has to be added when Containable is used)
Containable (this will allow the items to be listed)
Route (so you can link to a specific product)
This gives each product its own slug (URL)
Tags (to allow products to be categorized)
Now, you need to create a new List from the dashboard so you can display the products together (and inherit other features like pagination, etc). Be sure to select the Product Content Type in the Contains drop down list.
Then, you can start creating your Content (your Products) one by one. In the dashboard, click the new Product item and describe each new piece of Content.
Finally, you can link directly to this new List using the Products List's *slug*. You could (and might want to) add the Products List to your main navigation menu. Clicking the Products List and checking the "Show on main menu" box will automagically add a navigation button directly to this page. You could, of course, link to this List from anywhere using the slug (also found on the list's edit page)
This page, from the Orchard documentation pages describes more things you can do with a list of content like modifying the layout of the list, placing content fields in different places and even converting your products to widgets which you could use to display some promotional product offering in a special spot on your site.
I highly recommend reading through at least the documentation provided on the Orchard site to get a good grasp of what this CMS can do out of the box and what you would need to write custom code to accomplish (which you could do in this case, but Orchard can handle it out of the box)
Hope this helps!
Two ways to do this:
http://orchardproject.net/docs/Creating-lists.ashx and http://orchardproject.net/gallery/List/Modules/Orchard.Module.Contrib.Taxonomies

Drupal Views display newest content per taxonomy limit to one node

I want to create a view where all 5 of my taxonomy terms are displayed and it then displays the latest node published but this is limited by 1. For Example:
Tax Term 1
Latest node published
Tax Term 2
Latest node published
etc etc
Currently I'm grouping by taxonomy term so it's displaying all nodes published then sorted by published date desc. I can't quite figure out how to limit the nodes to only show one item per taxonomy term.
Any help would be greatly appreciated.
This is possible with Views 3. I've tested this on D7, but should work on D6 also.
Add a new view of type - Taxonomy terms
Add relationship - Taxonomy term: Representative node
Other - Use aggregation: Yes
Add field - Content: Title. Change Aggregation settings to Group results together
It's not great if you have a lot of nodes, but I've done this in other cases by using a filter for "Promoted to front page" - then you simple make sure you only promote one node at a time.
I'd suggest to use a combination of panels ans views.
First, create a (or use the default) view for nodes which takes a taxonomy term as argument. Second, create a panels page containing five regions. Each region is to be filled with a view (in fact it's going to be the same view from step one, but with different arguments). Within panels ui you can restrict the number of shown entries of each view, set this value to one to have only one article be shown per term.
Panels: http://drupal.org/project/panels
Views: http://drupal.org/project/views
I'd recommend checking out the Views Group By module.
http://drupal.org/node/389230
The tutorial listed above actually describes almost exactly what you are trying to do.

Resources