Since Views2 has gone through lots of changes recently, uc_product views integration has fallen behind and doesn't currently work with the latest version of Views. The attached patch brings the Views integration code back into line.

This patch is written against the latest Ubercart 6.x-2.x-dev (2008-Sep-23) and latest Views (6.x-2.0-rc4)

Two things I know I missed:
The field which references field_image_cache_fid in the default view(I'm assuming this is to make the product image available?)

And I haven't touched the bit which requires the 'editablefields' module, since this is unavailable for D6.

Please review and test.

CommentFileSizeAuthor
#3 uc_product_views2.patch29.25 KBmrfelton
uc_product_views.patch30.53 KBmrfelton

Comments

lyricnz’s picture

Status: Needs review » Needs work

Your patch updates uc_product/views/uc_product.views.inc but this file does not exist in 6.x-2.x-dev (2008-Sep-23) - it is at uc_product/uc_product.views.inc only. Duplicating the file, then applying the patch, seems to work basically okay, from my quick test.

andrewfn’s picture

This failed to apply completely because the last section of the patch is against the file:
uc_product/views/uc_product.views.inc
which does not exist in ubercart 6.x-2.x-dev
I don't think I am making a silly mistake, but please correct me if I am wrong. I got:

patching file uc_product/uc_product.module
patching file uc_product/uc_product.views.inc
patching file uc_product/views/uc_product_handler_field_buyitnow.inc
patching file uc_product/views/uc_product.views_default.inc
patching file uc_product/views/uc_product_handler_field_price.inc
patching file uc_product/views/uc_product_handler_filter_product.inc
patching file uc_product/views/uc_product_handler_field_addtocart.inc
patching file uc_product/views/uc_product_handler_field_weight.inc
can't find file to patch at input line 719
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: uc_product/views/uc_product.views.inc
mrfelton’s picture

StatusFileSize
new29.25 KB

Sorry, my bad. Please try this updated patch.

Island Usurper’s picture

Status: Needs work » Reviewed & tested by the community

It looks good to me. I uncommented the part about field_image_cache_fid in the default view, and it works just fine. However, I did just get CCK rc9, so they may have updated their Views integration fairly recently if you couldn't get it to work.

I don't use Views a whole lot, so I'd like one or two more good reviews before commiting it.

mrath’s picture

Thanks for patching. But i need more help. I get the errors:

- Error: handler for uc_products > sell_price doesn't exist!
- Error: handler for uc_products > is_product doesn't exist!
- Error: handler for uc_products > buyitnowbutton doesn't exist!
- etc.

can you help me please.

mrfelton’s picture

Where are you seeing these errors?

andrewfn’s picture

Patch applies properly now. Thanks!

mrfelton’s picture

@Island Usurper: is field_image_cache_fid relating to imagecache (which I don't have installed)? If so this would need to be added as a dependency, although I'd rather not force people into needing imagecache.

Island Usurper’s picture

It's actually a CCK Imagefield. I had just named it the image_cache field way back when uc_product was new. That field should be optional, so I'll tweak the default view to check that the field exists before I commit it.

mrath’s picture

@mrfelton:
when i open "/admin/build/views/edit/uc_products?destination=products#views-tab-page_1"

mrath’s picture

The Problem is away. Idon´t know what it was.

Thanks for the patch!

Island Usurper’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

geraldito’s picture

Is this patch commited to the newest head of ubercart 6.x-2.x-dev? have the same problem but can't apply patch.

acsooley’s picture

I am still having this problem with adding a image to a view from a product.

Any help would be great.

Adam

Island Usurper’s picture

At this point, 6.x-2.x-beta3 is probably newer than what's in the -dev package.

mikee’s picture

Status: Closed (fixed) » Active

I'm using Ubercart core 6.x-2.2 and Views 6.x-2.6.

When looking at the available "Fields" within Views I see the following:

  • Product: Add to cart form
  • Product: Buy it now button
  • Product: Cost
  • Product: List price
  • Product: SKU
  • Product: Sell price
  • Product: Weight

However, the dimensions are missing:

  • Product: Unit of Measurements
  • Product: Length
  • Product: Width
  • Product: Height

Any pointers on how to make these available in Views would be much appreciated?

tr’s picture

Status: Active » Closed (fixed)

@mikee: Please open a separate issue with your feature request.

code-brighton’s picture

hi mikee,

I'm having the same issue, trying to access product dimentions in views... Have you had any luck with this.

Thanks