This is G o o g l e's cache of http://www.ubercart.org/forum/development/564/uc_views_module_about_read... as retrieved on Aug 3, 2007 00:10:02 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?q=cache:5Xon-XthQvMJ:www.ubercart.org/forum...
Google is neither affiliated with the authors of this page nor responsible for its content.
These search terms have been highlighted: druru
Ubercart
* Home
* Documentation
* Forums
* Issues
* Livetest
Home » Forums » Ubercart » Development
uc_views module about ready - but a few questions and comments
Submitted by BullCreek on Wed, 03/28/2007 - 15:50
BullCreek
Posts: 48
Joined: 01/10/2007
Brain StormerGetting busy with the Ubercode.
I needed support for Views, because the combo of views and views_filterblock modules make it easy to achieve a fairly powerful product search using taxonomy terms (similar to what newegg.com has although not quite as fancy). I wrote a module called uc_views this afternoon that exposes ubercart product price, sku, and add to cart link so that it works properly with the Views module. For an example, visit my test site:
http://sustainablevps.com/ubercarta3/
Then click on Catalog->IP Phones (3).
You will see that by using Views, I have replaced the default ubercart catalog page with a view I designed (this just worked automatically thankfully).
Also note the "Power Search" on the side that allows users to filter the view based on a number of criteria. This code is provided by views out of the box and quite powerful.
Problems:
1. Clicking "Add to cart" on one of the items, always adds the first item. In my uc_views module, I use theme_uc_product_add_to_cart() to return the HTML for each row - problem is, that form code must just want to be embedded once per page, not multiple times. I'm hoping someone who knows more about Drupal's form API can help me make this work properly so the right product gets added when "Add to cart" is clicked.
2. The Power Search stuff is provided by "Exposed" View filters and the views_filterblock module. It works well, but because all ubercart products are node type product, taxonomy isn't nearly as useful as it could be. As you know, vocabularies can be assigned to node types only.
I have the following vocabularies thus far for the two types of products on the test site (Analog Adapters, and IP Phones):
* Analog Adapters
o Useful Attributes
o Price Range
o Manufacturers
o Protocol
o FXO Ports
o FXS Ports
* IP Phones
o Useful Attributes
o Price Range
o Manufacturers
o Protocol
o Ethernet Ports
o Line Appearances
o Power over Ethernet
Because ubercart just has node type 'product', I end up having to assign the superset of all vocabularies to it, and then make the ones that don't overlap non-required and then remember when creating new products which vocabularies go with which product type. I fear this will be very error prone! I've read that there isn't much interest in supporting multiple node types because you already have classes, but maybe this will provide a clear example of why it would be useful. Even if you just add it in similar to e-commerce's "is product" hack, I think it would increase ubercart usability tremendously.
All that said, if someone can help me figure out item 1, I will gladly contribute this module to ubercart if there is interest and someone tells me how.
Thanks, --B
* Add new comment
permalinkWed, 03/28/2007 - 16:04
Ryan
Posts: 1685
Joined: 09/26/2006
AdministratorCode Monkey Head - I eat bugs.
Just wanted to give you a quick "you da man" and let you know I'll check it out more in the morning. Eye-wink Our thought regarding the Newegg style search was to actually base it off of class fields instead of taxonomy... but perhaps that isn't realistic. I haven't looked into the Views API enough to know, but is it at all possible to expose the product classes and their fields?
You're right about the form thing... if all three forms have the same form id, it's going to execute the first one every time. Maybe the solution here is to append the nid to the form id (so they would be something like "uc-product-add-to-cart-form-2", "uc-product-add-to-cart-form-3", etc. I was doing this a while back for forms on the order admin screen and then just used hook_forms to make sure those all mapped to the correct form function. I can see this functionality being useful elsewhere, too.
* reply
permalinkWed, 03/28/2007 - 16:31
Lyle
Posts: 569
Joined: 09/26/2006
AdministratoreLiTe!
I'd say something new and useful, but I think Ryan's already said it. I think it's safe to say that product classes will grow and improve in the not-too-distant future.
* reply
permalinkWed, 03/28/2007 - 16:39
BullCreek
Posts: 48
Joined: 01/10/2007
Brain StormerGetting busy with the Ubercode.
Views admin UI is so big and complicated at first glance, that I think it scares most people off. It would have scared me off too, but luckily, you guys took longer than anticipated to release ubercart. Smiling While waiting, I spent some time trying to get e-commerce to do some or all of what I wanted just in case, and that lead me to the views/taxonomy combo which also works in ubercart with the aforementioned caveat.
In answer to your question about product classes/field, I wanted to try it out, but I'm having trouble getting the fields to show up with the values I set. I turned on clean urls, and that made the field names show up on the edit node page, but the values still don't show. Off the top of my head, I think if the fields are stored as part of taxonomy, it might work - if not, I might be able to extend my views module to make it work. I didn't look any further when I ran into the field bug but I will if you can tell me how to fix it.
On the forms stuff, that seems logical, but a bit over my head. I think I am passing the proper nid as the first argument to the function, but as you say in the HTML, they all show up the same. If you have time, further comment would be appreciated. --B
* reply
permalinkWed, 03/28/2007 - 17:15
psi-borg
Posts: 117
Joined: 03/20/2007
Getting busy with the Ubercode.R2D2, I am your father.
comment: swuuuuheeeeeet, doooooooood
--
zeni.mobi
* reply
permalinkThu, 04/05/2007 - 17:26
druru
Posts: 221
Joined: 03/21/2007
Brain Stormer
Although I can NOT see what you're doing (you're site is down), something tells me you're moving into some really vital feature territory.
I'd love to see your views implementation.
Any more headway on the issues described in this thread?
thanks
* reply
permalinkFri, 04/06/2007 - 09:58
BullCreek
Posts: 48
Joined: 01/10/2007
Brain StormerGetting busy with the Ubercode.
I was having some problems with classes and attributes not working properly in my alpha3 install - so I sort of went into a holding pattern. I'm also in the process of moving the test site to a dedicated server (it was running on my laptop before which is why you can't access it anymore).
I see that alpha4 is out now, so I'll try it out today, and if classes and attributes work as I think they're suppose to, I'll try to extend my module such that it uses them instead of taxonomy for searching. I'm also working on a "Review" module that will work with ubercart, similar to what newegg has.
I'll give an update next week when I've made further progress.
* reply
permalinkFri, 04/06/2007 - 10:52
Ryan
Posts: 1685
Joined: 09/26/2006
AdministratorCode Monkey Head - I eat bugs.
A review module would be awesome... I'll have to make the checkout confirmation page extensible via a function so you can add dynamic info to it...
* reply
permalinkMon, 04/09/2007 - 21:43
izi
Posts: 61
Joined: 03/25/2007
Getting busy with the Ubercode.
I was about to sit down and write a uc_views module myself today when I stumbled across this thread. Any news on when we might see a copy of this module, even if its a not 100% working yet? I'd be happy to contribute to it as well...
* reply
permalinkTue, 04/10/2007 - 09:46
BullCreek
Posts: 48
Joined: 01/10/2007
Brain StormerGetting busy with the Ubercode.
I can send you a copy if you like. I basically just took the module from e-commerce and ubercartified it. I'm working on adding support for product classes and using exposing their fields now so you can use that instead of or in addition to taxonomy to setup search filters.
If you are a whiz at forms API, maybe you figure out how to fix the problem with having multiple Add to Cart buttons on one page mentioned earlier in the thread assuming one of the uber developers didn't already fix it in alpha4. PM me with an e-mail address and I'll tar it up and send it your way. I think it will be pretty slick once it is all working!
* reply
permalinkTue, 04/10/2007 - 16:23
druru
Posts: 221
Joined: 03/21/2007
Brain Stormer
hey bc,
I've refrained from views development up to now concentrating on other drupal internals but wouldn't mind taking a look at what you've done. it's probably time to start learning views as it is integral to drupal. so i wouldn't mind if you send me a copy. maybe i can provide some feedback.
thanks
* reply
permalinkWed, 04/18/2007 - 14:29
BullCreek
Posts: 48
Joined: 01/10/2007
Brain StormerGetting busy with the Ubercode.
The test site is available again at:
It now supports filtering on ubercart product class fields (at least of type radio, checkbox, or select).
I have posted some screenshots that show how the views are setup to enable filtering:
http://sustainablevps.com/files/Screenshot1.png [shows the two views I've created for my two classes]
http://sustainablevps.com/files/Screenshot2.png [basic views options]
http://sustainablevps.com/files/Screenshot3.png [what fields to display and options]
http://sustainablevps.com/files/Screenshot4.png [filter on class & published, expose others to use]
http://sustainablevps.com/files/Screenshot5.png [set options for exposed filters]
Note that I used taxonomy for common attributes amongst all product classes (i.e. useful attributes, price range, and manufacturer) and ubercart fields for product class specific things.
Soon I hope to setup VNC and record the whole views setup process to a movie with audio similar
to how the drupal-dojo guys are doing it. If it works out, I think that might be a good way to explain ubercart in addition to the written manual.
Also note that in addition to the "AND" type filtering on the test site, views also supports "OR" and "XOR" by changing the options on the exposed filters (newegg.com for example has both AND and OR filtering via their "Advanced Search" and "Power Search" respectively. I haven't written the code for OR and XOR yet, but it shouldn't be difficult, although the default views UI for OR and XOR isn't as slick as neweggs.
Lastly, I'm not happy with the way images are being handled. I love the fact that you can now assign multiple images to a product, and I love thickbox, but I don't like the way they interact with views, although I haven't really dug into it yet. Click on the images on the views generated pages, and you'll see what I'm talking about.
If anyone still wants the code, or if you guys want to incorporate it into alpha6 let me know. --B
P.S. I had to make a minor change to uc_product.module to fix the multiple add to cart button problem (basically had to add a hook_forms handler). Doesn't seem to have broken anything.
* reply
permalinkWed, 04/18/2007 - 15:06
Ryan
Posts: 1685
Joined: 09/26/2006
AdministratorCode Monkey Head - I eat bugs.
Yeah, seeing the code would be awesome, and we'd love to incorporate that functionality in the code for others to use/build on. I don't know if we'd be able to get it in Alpha 6, as that's nearing release, but certainly Alpha 7. Smiling I'd love to see what you cook up with the video, too. Having screencasts of Ubercart would be extremely cool and a great way to show off the order administration interface. Can't wait to see what you come up with.
Also, if you have any way to make patches and can create one for your changes to uc_product.module against the alpha 5 version of that file, we'd be able to review it and possibly put that at least into Alpha 6.
By image support on the Views, I take it you mean the fact that it lets you browse Next/Prev through all the images on a page? I'm sure there's something we can do to restrict that... I know Lyle's customized Thickbox a little bit for our Livetest. Sticking out tongue
One thing I'd love to see is a more concise form. I know that has a lot to do with the theme (Garland) being all spread out, but we can at least play with it now. Maybe even have an "advanced sort" page that simply displays that form with the labels/options inline. Also, is it possible to make those header columns nowrap so you don't end up with the arrow below the title?
* reply
permalinkWed, 04/18/2007 - 15:34
Lyle
Posts: 569
Joined: 09/26/2006
AdministratoreLiTe!
Very cool. Having this kind of functionality should be useful to a lot of people.
When Thickbox creates galleries of the images on a page, it uses the "rel" attribute of the links to determine which images should be linked together in a gallery. Since all the image links in the view have rel="product", Thickbox thinks they all go together. If you're sure you'd have each product appear only once in any particular view, you could append the node id it to make them as different as necessary, keeping each product's images together.
* reply
permalinkWed, 04/18/2007 - 15:49
druru
Posts: 221
Joined: 03/21/2007
Brain Stormer
bc,
that's pretty awesome!
i'd like to see the code if you could post or send it. Smiling
Qs :
==============
1a) I'm wondering how you got the views filter to appear as a sidebar block? did you post a block a views exposed filter snippet into a block and enable page visibility on the block? if so, could you post that snippet?
b) Since you have so many different vocabs as filters, could you give examples as to how arguments as term ids could be used to create one useable and context sensitive url path to access a variety of products in addition to simply using the filters?
Not sure if that makes sense but when you select to filter a given product, you are taken to 'node/1' or 'node/3', etc. It would be great if the url path looked something like:
catalog/analog_adapters/digium/s101
This kind of plays into my suggestion below (see number 6) about pathaliasing, breadcrumbs, etc
Concerns / Suggestions :
==================
2) Regarding multiple imgs - i think that's pretty solvable via a views handler or theming.
3) Speed. That looks like a lot of filtering over multiple taxonomy categories. Any way to guage how that pans with lots of products/taxonomies?
I ask because for whatever reason, even using d5 on my localhost for a non ecomm site, my page loads tend to be sluggish. Especially that first page load for any local site. Still don't know why?
4) I'm wondering if there is a way to reuse the existing uc class, mfg and attribute fields versus having to superimpose core taxonomies over them?
I'm no expert here and don't have an answer as to how to do it so just asking the question. I'm pretty sure it can be done though.
It seems like we are wasting the power of native uc here. Using native uc fields would probably be faster (although i can't say for sure) and save duplication of classification schemes since the categorization is already implemented in the class, mfg, attributes fields.
Of course this makes it more difficult for the guy adding views support to uc because they have to dig into the uc code deeper and provide the filter hooks. Eye-wink
Either way, it would be nice to use both the native uc fields as well as taxonomy. Together one would have a lot of powerful options at their hands!
Your example shows the power of drupal core taxonomies plus views applied to uc products though and how architecting goes back and forth between trying to create new functionality in new modules, using preexisting functionality or combining where the 2 shall meet.
It also brings up the issue of why it might be good to extend uc products to allow for being multipe drupal product content types (another discussion). When you can start to visualize the benefit of something (e.g. seeing your views example with one's own eyes) the light bulb goes off and you go .."now i see" Smiling
5) Your sidebar filter block pushes the catalog block way down the page once a product is selected so it's hard to get back to teh catalog. You probably just slapped your example together but it probably would be better to always have that catalog block in view.
And to that end, i wonder if some css could be applied to that filter block so that it is smaller so that the user doesn't have to scroll to fill in and submit the filters. Maybe it would be possible to create a region that sits on top of the product node{s} and display the filter block select menus horizontally. That way it's always at the top of the page. the filters are collapsible so that does save space somewhat. still probably better to retheme this though.
Again, these are probably very doable using themes, blocks, template.php, etc and will need to be done by each admin at install time.
6) Your products are naturally nodes and not path aliased. When one clicks on a product, all context back to any product nesting is lost both in the url and the sidebar context.
One either hits back button or starts at the beginning of the catalog tree and works down again. There are no breadcrumbs to suggest where one is in the product hiearchy.
My suggestion is one for all of UC. We need a better way, either automated, manually by following block/theme configuration instructions or a combination of both to create products within categories (multilevel) that produces navigable breadcrumbs and possibly expandable category menus with active selected item.
fwiw, i think this is vital functionality required of a decent shopping cart, especially if it has lots of nested products.
fwiw, that expandable context sensitive menu block item thing may already exist but i can't tell from the uc livetest or your example because there are not any multilevel products defined (i think?).
Wow that's a lot of qs and suggestions...
thanks for your efforts here!
* reply
permalinkWed, 04/18/2007 - 15:58
BullCreek
Posts: 48
Joined: 01/10/2007
Brain StormerGetting busy with the Ubercode.
I haven't even looked at formatting yet, but have it on the list. Garland certainly spaces things out by default, and like you, I don't quite know why they even used the fieldset except it was an easy way to get the label there. If you and any others who want the code PM me your e-mail addresses, I'll tar up the uc_views module and diff to alpha5 uc_product.module and send it out.
I'm currently not implementing a "default" view, but probably should if you think you might want to include the module out of box with alpha7. E-commerce's views module sets their default view to replace q=products which I think would work fine for ubercart also. It would just list all the products, with the same four fields/sorts I've been using (image, description, price, options/add to cart) - but no filters by default. If that sounds sensible, I'll add it before sending it out.
* reply
permalinkWed, 04/18/2007 - 16:20
BullCreek
Posts: 48
Joined: 01/10/2007
Brain StormerGetting busy with the Ubercode.
druru, in regards to your questions:
1a) I used the views_filterblock module unmodified (although I suspect I may have to modify it to get the formatting I want especially for OR searches).
1b) I have played around with views arguments, and they are powerful, and I can envision many cases where you could just have one view that you passed a bunch of different arguments to make it behave how you wanted. I'm not sure that you will be able to dynamically expose different sets of filters based on arguments though, so that may be a limitation (I tried and couldn't figure it out but know alot more about the code now than I did when I first tried).
I totally agree about the pathalias/breadcrumb comments and hope the ubercart guys are thinking about including this as an option - even using q=products/SKU would be an improvement over node/n.
3. I haven't noticed it being slow locally, but I need to add a lot more products (among other things so I can test the pager options as well as overall performance). It may appear slow to some of you guys, because the server is at my house and we live out in the sticks where DSL upload speeds are only about 20kb/s. It does do some fairly gnarly joins (had to pull out my SQL for dummies book to even figure out what the hell they were doing) - but the size/speed should be based on how many fields/vocabs you search at one time, not how many fields/vocabs you have (i.e. the ones left Any don't impact the SQL statement at all).
4. UC classes and manufacturer really are just taxonomy - so no additional work/overlap was required.
5. Noted. I need to set the weights better. It needs alot of polish on the "pretty" front. Like you say, an expandable context sensitive menu block would be nice, but thus far has proven illusive (I looked but did not find).
6. Totally on the breadcrumbs stuff. Newegg does it well, and theirs is even tied into their filters (i.e. you can change filters just by clicking the little (x) in the breadcrumb). Ubercart needs something like that - although getting that fancy would probably be *a lot* of work. I haven't had time to fully understand how breadcrumbs work from top to bottom, but I agree that having them work properly for e-commerce is very important and so will be looking at that soon.
Hope that answers your questions.
* reply
permalinkWed, 04/18/2007 - 18:39
druru
Posts: 221
Joined: 03/21/2007
Brain Stormer
bc, i pm'd you for the module code.. thanks in advance!
1) ah.. views_filterblock.. i didn't know that existed
3) LOL.. you're supposedly slow DSL upload pages load much faster than my localhost non-ecomm developed sites? Smiling. Though this is off topic, do you have any suggestions why my localhost drupal site pages might be loading so slow? Especially the first page load for a given site. just thought i'd ask because like i said your site runs faster than my local ones Eye-wink.
I don't think i'm doing anything crazy, simple node loads. wonder if it's js. i also do have aggregator running. maybe it's fetching feeds.
4) right.. so are you saying you just used those same uc vocabs in your views (e.g. you didn't recreate them)? Brilliant if so!
thanks
* reply
permalinkThu, 04/19/2007 - 09:24
Ryan
Posts: 1685
Joined: 09/26/2006
AdministratorCode Monkey Head - I eat bugs.
druru, I've experienced slow localhost sites in the past, too... it may just be the nature of the beast. Granted, I haven't had any problems lately. Sticking out tongue
If you want some good free hosting for testing, you can check out Grinhost.com. I use them for my blog, and they just want you to post some content to the forums... not a big problem.
* reply
permalinkThu, 04/19/2007 - 10:04
BullCreek
Posts: 48
Joined: 01/10/2007
Brain StormerGetting busy with the Ubercode.
I have posted the code and patch for alpha5 at:
http://sustainablevps.com/files/uc_views-alpha5.tar.gz
Untar inside the modules/ubercart (or I guess modules) folder and then run:
$ patch < modules/ubercart/uc_views/uc_product.module.diff
Regarding performance issues - my site is running on a Xen paravirtual VM with debian sarge and mysql 4.1 using apache2 and PHP5. Could it be a DNS issue? Does it run faster if you connect directly to the IP address rather than the DNS name?
P.S. I noticed in reviewing the code before posting that displaying field values as a column in the views table is not fully implemented. I'll post an update when it is.
* reply
permalinkThu, 04/19/2007 - 14:53
druru
Posts: 221
Joined: 03/21/2007
Brain Stormer
bc, thanks for posting the code.. hopefully i'll get to look at it soon!
regarding my site speed:
ryan:
i can't help but think my localhost (browser and server are on teh same box) will and should beat any host provider out there. of course it's a windows box with wamp running on it but unless i've got my php.ini or apache / mysql config'd poorly, i've got enough horespower to be powering my local sites.
bc:
dns / ip address shouldn't be an issue. i'm running on my localhost?
fwiw, when i take my sites live i'm planning on running them on a centos 5 linux server. for now i'm on my localhost win box. have you had good experieince with your deb sarge (i'm very much a red hat guy from past work experience)? how bout' xen? i'm not sure i want to virtualize when i go live.
* reply
permalinkThu, 04/19/2007 - 16:24
BullCreek
Posts: 48
Joined: 01/10/2007
Brain StormerGetting busy with the Ubercode.
FWIW, I updated the module and test site to properly display fields using views, so if you downloaded already, you might want to snag it again.
Note to ubercart devs - to get checkboxes working, I had to remove the INDEX constraints from uc_product_class_choices. As it is currently written in alpha5, when you go to insert more than one row when more than one checkbox is checked, it barfs. Simple fix to uc_product.install I think.
To see it in action, click on the new catalog category called "Test Products".
* reply
permalinkThu, 04/19/2007 - 16:27
Ryan
Posts: 1685
Joined: 09/26/2006
AdministratorCode Monkey Head - I eat bugs.
You rock. Enough said. Cool
(Well, almost... feel free to add handbook pages where appropriate... I'm not sure what section this would go under. I'm up for suggestions. In fact, you can just post an outline and idea of where in the handbook it would go in the documentation forum. Perhaps we can setup a project here on the site for Ubercart views integration and give it its own issue tracker?)
* reply
permalinkFri, 04/20/2007 - 09:51
BullCreek
Posts: 48
Joined: 01/10/2007
Brain StormerGetting busy with the Ubercode.
I've been thinking about the documentation too. It sort of seems to me like just an "Extending Ubercart Using Views" section might be in order somewhere in there, whereby we explain that Views allows extending how the product catalog is displayed above and beyond what is provided out of box. Specific feature benefits to be explained would be:
1. Choosing columns to display
2. Allowing users to sort product items certain ways
3. Filtering product items on various criteria (taxonomy, ubercart fields, CCK)
4. Setting up paging (i.e. breaking a long list of items into pages 10 or 20 at a time to minimize server load)
5. Themeing Views
If this makes sense to you, I'll take a look at the existing documentation sometime next week and make a stab at retrofitting this section in.
As far as the issue tracker goes, I think that would be a good idea. Let me know when/if it is available and I'll subscribe to it.
* reply
permalinkFri, 04/20/2007 - 16:09
druru
Posts: 221
Joined: 03/21/2007
Brain Stormer
Sounds like a good plan to me Smiling
* reply
permalinkWed, 05/30/2007 - 05:13
zmove
Posts: 32
Joined: 03/23/2007
Brain Stormer
Hi guys,
Is the package above can be used on ubercard alpha 6b ? Because I really need an integration with view very quickly (I begin my site with ecommerce module and, as ubercard looks very promising and more active, I switched at the last moment just before add my products). ^^
So at the moment I add products but I don't have the possibility to show them for customers (because catalog module don't go for me).
* reply
permalinkThu, 06/14/2007 - 07:39
K.P.
Posts: 17
Joined: 03/20/2007
Bug Finder
Any news, here?
Download isn't available any longer (requires authorization).
* reply
permalinkFri, 06/15/2007 - 11:23
BullCreek
Posts: 48
Joined: 01/10/2007
Brain StormerGetting busy with the Ubercode.
Sorry - it should be fixed now. I haven't tested it with the latest development snapshot, but it should still work. Let me know if you find any problems. I've been busy with other projects, but hope to get back to both this and the uc_review module later today and finish them up both code wise and documentation wise.
* reply
permalinkTue, 06/19/2007 - 10:15
BullCreek
Posts: 48
Joined: 01/10/2007
Brain StormerGetting busy with the Ubercode.
I put a new version of the module up that has been fixed to work with alpha6c/latest greatest. It is also much more complete. Here is what it exposes via Views:
Fields & Sorts:
Product: SKU
Product: List Price
Product: Cost
Product: Sell Price
Product: Weight
Product: Add to cart link
Filters:
Product: Is Product
It also creates a default view to replace the "products" view that ubercart provides out of box to help get you started with some sensible settings. Gone of course is the fields stuff - because views already has great support for for Taxonomy and CCK (although I will say that I learned a heck of a lot about views by writing the code to expose fields in alpha5 so no complaints Smiling
You can download it from:
http://sustainablevps.com/files/uc_views-alpha6c.tar.gz
I haven't updated the test site above to alpha6c yet because I'm developing on my laptop at the moment, but will later today or tomorrow once I get the uc_review module updated.
* reply
permalinkTue, 07/03/2007 - 01:11
webmasterkai
Posts: 10
Joined: 05/17/2007
The fields are pulling from the wrong node or not pulling any data at all.
If they do pull data, it is from a different node (same node for the different fields). List, cost and sell price are most frequently missing data. I'll have david look at it tomorrow.
* reply
permalinkTue, 07/03/2007 - 08:44
BullCreek
Posts: 48
Joined: 01/10/2007
Brain StormerGetting busy with the Ubercode.
Sounds strange. What versions of PHP/MYSQL, etc are you using?
* reply
permalinkTue, 07/03/2007 - 09:06
webmasterkai
Posts: 10
Joined: 05/17/2007
It is really strange Shocked
MySQL 5.0.27
PHP 5.2.3
* reply
permalinkTue, 07/03/2007 - 10:21
BullCreek
Posts: 48
Joined: 01/10/2007
Brain StormerGetting busy with the Ubercode.
What version of views, and have you tried clearing your views cache (which is easier if you are running the latest greatest version of views).
* reply
permalinkTue, 07/03/2007 - 15:43
webmasterkai
Posts: 10
Joined: 05/17/2007
I am using the latest version Views-5.x-1.6-beta5 (right?)
I tried emptying the cache with no luck.
* reply
permalinkTue, 07/03/2007 - 18:53
david
Posts: 46
Joined: 05/30/2007
Bug KillerGetting busy with the Ubercode.
on behalf of webmasterkai, i have partially debugged this. the problem seems to reside in the query that comes out of _views_build_query() in views_query.inc.
the culprit is ...
SELECT node.nid, node.title AS node_title, node.changed AS node_changed, uc_products.sell_price AS uc_products_sell_price, uc_products.model AS uc_products_model, node.type AS node_type
FROM node node
LEFT JOIN uc_products uc_products ON node.vid = uc_products.nid
ORDER BY node_title ASC
LIMIT 0 , 100
when it should be ...
SELECT node.nid, node.title AS node_title, node.changed AS node_changed, uc_products.sell_price AS uc_products_sell_price, uc_products.model AS uc_products_model, node.type AS node_type
FROM node node
LEFT JOIN uc_products uc_products ON node.nid = uc_products.nid
ORDER BY node_title ASC
LIMIT 0 , 100
however i have no idea how to fix this or why its trying to match a views ID with a node ID.
Anybody know what might be causing this? or how to fix it?
* reply
permalinkTue, 07/03/2007 - 19:30
david
Posts: 46
Joined: 05/30/2007
Bug KillerGetting busy with the Ubercode.
answering my own question...
in uc_views.module
<?php
function uc_views_views_tables()
{
$tables['uc_products'] = array(
'name' => 'uc_products',
'join' => array(
'left' => array(
'table' => 'node',
- 'field' => 'vid'
+ 'field' => 'nid'
),
?>i think this is the correct way to fix it.
* reply
permalinkTue, 07/03/2007 - 20:30
druru
Posts: 221
Joined: 03/21/2007
Brain Stormer
I ain't no views expert.. but are you sure you're not supposed to be using the vid? i kind of thought the vid contained all the latest info (especially if a node is versioned.. just checking
* reply
permalinkTue, 07/03/2007 - 20:46
david
Posts: 46
Joined: 05/30/2007
Bug KillerGetting busy with the Ubercode.
No idea. All I know is the fix above fixed our broken views with ubercart product fields in it (sell_price, model). Im hoping for some feedback here and further testing from the community because I don't really understand why the query being run was trying to match node.vid to uc_products.nid. It may have been that way by design, in which case the problem we had was due to something else being broken.
* reply
permalinkWed, 07/04/2007 - 20:08
mimetic2
Posts: 100
Joined: 05/09/2007
Bug Finder
bullcreek-
is there any information on UC-reviews module? cant wait to see it.
* reply
permalinkFri, 07/06/2007 - 08:15
BullCreek
Posts: 48
Joined: 01/10/2007
Brain StormerGetting busy with the Ubercode.
Sorry for the slow response - I have too many irons in the fire at the moment.
mimetic2:
You can download the uc_review module from the same place:
http://sustainablevps.com/files/uc_review-alpha6c.tar.gz
After extraction, you'll need to copy or symlink the node-uc_review.tpl file into your theme directory if you want it to look like it is suppose to (customize to your liking of course). Also, note that the review page won't show reviews or aggregate score info for reviews until they are published (this allows you to manually moderate them using the batch admin/content/node interface by turning published off for Review content type) and you'll want to adjust the access control to your likings.
others on the vid issue:
I'd like to try and replicate this problem. I'm pretty sure that vid is the proper thing to use, and it works fine on both my test system and production server - so I'm not quite sure why it doesn't work on your system. Do you have node versioning enabled or anything out of the norm you can think of. I never tested it with node versioning enabled, but will today.
* reply
permalinkFri, 07/13/2007 - 19:27
IX
Posts: 24
Joined: 07/13/2007
I'm working on a site, and want access to the products fields in views (specifically, add to cart button and variations).... is there a version that works with 7b yet?
* reply
permalinkThu, 07/26/2007 - 02:00
darxtar
Posts: 15
Joined: 07/04/2007
Hi all,
I've been figuring out how to display price in views using uc_views module with format according to the Ubercart configuration.
Finally found out that a handler function required to themed the price field prior to be displayed by views module. So I create a new function in uc_views.module:
function uc_views_handler_product_sell_price($fieldinfo, $fielddata, $value, $data)
{
return theme_uc_product_sell_price($value,1);
}
And add the following line:
'handler' => 'uc_views_handler_product_sell_price',
to function uc_views_views_tables(), under:
'name' => t('Product: Sell Price')
And now it works. You can see it at www.toyzhunt.com =)
* reply
permalinkThu, 07/26/2007 - 07:58
Ryan
Posts: 1685
Joined: 09/26/2006
AdministratorCode Monkey Head - I eat bugs.
Awesome! We need to get a Views section in the User's Guide so we don't lose the tricks like this. Smiling
Let this be a start: http://www.ubercart.org/ubercart_users_guide/views
* reply
permalinkThu, 07/26/2007 - 08:37
darxtar
Posts: 15
Joined: 07/04/2007
Hi Ryan, I've added a child page to explain how to theme the price. =)
JacK
* reply
permalinkThu, 07/26/2007 - 08:45
Ryan
Posts: 1685
Joined: 09/26/2006
AdministratorCode Monkey Head - I eat bugs.
Great! Thanks for taking the time. Only formatting thing I'm going to do to it is wrap your PHP in tags to format it. btw, I love the Gundam statues. Eye-wink
(Feel free to change if I screwed something up on the page.)
* reply


Joined: 08/07/2007