Closed (fixed)
Project:
Apachesolr Ubercart Integration
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Oct 2010 at 18:02 UTC
Updated:
26 Jan 2012 at 18:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
mrP commented+1 on this.
I was going to give http://drupal.org/project/uc_attribute_cck a stab and see if I could index attributes in this round about way via CCK fields. Pretty good intro here (http://acquia.com/blog/understanding-apachesolr-cck-api) on working with CCK fields and Solr...seems like it could be doable.
If anyone has tried this, successfully or otherwise, chime in. I'll report what I turn up.
Comment #2
zkrebs commentedSubscribing. This would be really excellent. As far as I can tell, there's no way to browse through product attributes easily. Could I suggest that Apache Solr can know if the products are in stock or out of stock (per attribute - size)? This is useful, because if I want to say
Buy now, 10% off remaining medium Tshirts, I want to present a list of ones we actually have! If its out of stock, that's useful too, for backordering.
Comment #3
nick_vhI'm not so familiar with product attributes but it seems trivial indeed. If someone could post me a .make file + db dump for a good usecase of attributes of product so we can all develop towards the same use case. This would prevent us from getting confused with eachother!
If someone likes to take a stab to this, please report back here
Comment #4
joe_pixelrow commentedBeing able to use attribute options like size and color as a solr search filter would be so great!
Comment #5
zkrebs commentedNick_VH, I have no idea how to make a .make file but if you gave me access to a dev site I'd be more than happy to create a standard ubercart attribute set up.
How about a tshirt store, with color and size as attributes applied to the product class, "Tshirt".
"Awesome" Tshirt - base price, $15.00
Colors: Blue, Red, Green, Orange, Purple
Size: Small, Medium, Large, Extra Large, Extra Extra Large
Product attribute adjustments
Small Blue - sb001
Medium Blue - mb001
Large Blue - lb001
Extra Large Blue - xlb001
Extra Extra Large Blue - xxlb001
Stock *important part of filtering*
sb001 - 20
mb001 - 0
lb001 - 2
xlb001 - 3
xxlb001 - 5
Price Adjustments -
sb001 - 0
mb001 -0
lb001 - 0
xlb001 - 2.50
xxlb001 - 3.00
And so on and so forth.
If I could see a listing of all tshirts first, then with filtering options:
TYPE: TSHIRT
SIZE
COLOR
STOCK - In Stock / Out of Stock
PRICE: <$10 <$20 <30 etc.
Hope that helps?
Comment #6
mrP commentedHey Nick_vh. If you get this working I'd totally throw in a bounty on it.
I've attached a simple .make file and a really basic database for a site. database/site passwords are in the make file.
What I've made is a three term taxonomy: products = shirt, shoes, pants
I made two attribute sets with three options each. One for shirt sizes (Small, Medium, and Large) and another for shirt colors (red, black, white). The "red shirt" is available in all sizes but only color red. The "small shirt" is available in all colors but only the small size.
This serves as a basic example of searching based on attributes. The goal with this is to be able to drill down on products based on which attributes are associated with a particular product node.
If you want something more complex I'll be happy to add more products or attributes.
@slavojzizek: price search facets already exist via http://drupal.org/project/apachesolr_ubercart. Stock is also separate from attributes and should probably be handled in a different feature request (unless of course Nick_vh is feeling ambitious :-) )
Comment #7
nick_vhSorry for replying too late - Working on this ;-)
Comment #8
nick_vhFirst stab at this issue
Generates a block per attribute and fills the solr database with all the options that are used in the nodes (not in the system)
Indexes the option id but displays the human readable name for these options.
Let me know what you think
The patch also cleans up some code and a little bug I found
Ps : Using the database + make file previously added. I did have to enable some modules to make it a bit usable but no problems encountered. For possible problems, please upload a database with the generated data that is causing problems
Comment #9
zkrebs commentedsites/all/modules/apachesolr_ubercart$ patch -p0 < 947584-apachesolr_ubercart.patch
patching file apachesolr_ubercart.module
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 40.
Hunk #3 succeeded at 73 (offset -10 lines).
Hunk #4 succeeded at 113 (offset -10 lines).
Hunk #5 succeeded at 124 with fuzz 2 (offset -15 lines).
Hunk #6 FAILED at 167.
Hunk #7 succeeded at 163 with fuzz 2 (offset -18 lines).
Hunk #8 FAILED at 214.
Hunk #9 FAILED at 253.
Hunk #10 FAILED at 263.
Hunk #11 FAILED at 368.
Hunk #12 succeeded at 267 with fuzz 2 (offset -138 lines).
7 out of 12 hunks FAILED -- saving rejects to file apachesolr_ubercart.module.rej
with the recent DEV - ideas?
Comment #10
nick_vhPlease patch to the HEAD version, not the DEV :)
No problems here while patching
patch -p0 < nameofpatch.patch
Comment #11
zkrebs commentedWhere do I get that? Is that the 1.2 version? Sorry, n00b question.
Comment #12
nick_vhPlease look here for detailed instructions :-)
http://drupal.org/project/apachesolr_ubercart/cvs-instructions OR http://drupal.org/node/290118/cvs-instructions/HEAD
In attachment you can find the complete .module file so you can try it out that way also.
Comment #13
mrP commentedThanks for putting this together! I'm just getting around to testing this out and it seems that HEAD is r1.11 and patch is for 1.10. Did you apply this patch to HEAD already?
Also, when working with the HEAD version, I've been getting a couple of errors:
(1)
Recoverable fatal error: Object of class stdClass could not be converted to string in theme_status_messages() (line 1168 of .../includes/theme.inc).(2)
Fatal error: Call to undefined function dsm() in .../modules/contrib/apachesolr_ubercart/apachesolr_ubercart.moduleFor (2) I changed the call to dsm() to drupal_set_message() and resolved the error message. However, the blocks page and admin/settings/apachesolr/enabled-filters are inaccessible when the module is enabled. (1) also disappears when the module is disabled.
Comment #14
mrP commentedFYI to others testing, current HEAD (as of v 1.11 2011/02/04) already has patch in #8 applied.
Comment #15
mrP commented@Nick_vh: My .make file capabilities wane at install profiles... I did think that there was two products in the database already. Was this not the case?
Comment #16
nick_vhSorry for delayed reply. I indeed committed this to HEAD as it seemed bit more reasonable for testing purposes.
I removed the "DSM call" and committed this to HEAD (no need for separate patch I suppose)
About the fatal error - could you be so kind to investigate where this comes from because on the install profile/make file you supplied I do not have this error. Also the enabled-filters are working as expected here so I do not completely understand the cause of the problem.
Comment #17
nick_vhFYI : dsm is a function used by the devel module for debugging purposes. By renaming this to drupal_set_message will cause conflicts since drupal_set_message is not able to print array or objects of any kind. This explains the 2 error messages.
Recent head ships without this so please download and test this version.
Comment #18
mrP commentedThis is absolutely awesome! Works perfectly.
I'm marking as needs review to see if someone else can try it out. Shoot me a paypal email and I'll throw you some bounty.
Comment #19
melon commentedI applied the patch manually in 6.x-1.2 and it's working great for me also. Thanks for this feature.
Comment #20
melon commentedI just found that the only the attribute option oid value is shown in the apachesolr breadcrumb.
You can add this code to enable themed output of the attribute option name in the breadcrumb:
Comment #21
mrP commentedVery nice!! thanks melon
Comment #22
nick_vhFinally some work with this. Did a diff on the latest dev version. Seems that I made some mistakes before
Comment #23
nick_vhLatest one, also tested
Comment #24
nick_vhCommitted