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
Would it be possible to make these fields available in Views?
| Comment | File | Size | Author |
|---|---|---|---|
| #24 | ubercart-views_field_default_qty-730120-24.patch | 917 bytes | stewart.adam |
| #13 | ubercart-730120.patch | 2.81 KB | 5n00py |
| #9 | ubercart-730120.patch | 1.97 KB | 5n00py |
Comments
Comment #1
5n00py commentedSorry, meybe this is offtop, but.
I have problem with dimensions.
On hook_load ubercart set variables like this:
$node->Length;
But on hook_update and hook_insert that use variables like this:
$node->dim_length;
S if I run this code dimensions is set to 0;
Comment #2
dzieyzone commentedtry to use node instead of fields. You can create a separate display by using this template node-view-.tpl.php
Comment #3
melchoir55 commentedSo I've accomplished this with some php code. Not sure if that is wise, but it is the only thing I could think of.
I created a custom php field with the custom fields module. the code begins with
This dumps all the data relating to the product into $node. You can then inspect it using devel to get whichever variable names you want. Then you just add some
lines for what you want printed.
Comment #4
lpalgarvio commentedsubscribing...
we need dimensions in Views/Panels/Display Suite
Comment #5
rodmarasi commentedya, i need this feature too. we want to manipulate dimension, package quantity and shipping field. this is what makes drupal great. we can manipulate the module fields.
Comment #6
lpalgarvio commentedNo support for dimension in Views yet.
also, no dimension or weight support in Panels yet. and the dev module is not even an official release yet.
I'm loosing all confidence in Ubercart and it's team.
Comment #7
3cwebdev commentedSubscribing. I'm also surprised that this feature hasn't been implemented yet.
Comment #8
jazznight17 commentedSubscribing. agree with setfree.
Comment #9
5n00py commentedI created patch for this issue.
I just added db fields to views definitions with default handlers.
In this patch included only 3 fields:
UPD:
This patch for lastest dev revision for 6.x.
Comment #10
3cwebdev commentedAwesome! Seems to be working, thanks! Any chance of getting the package quantity and shipping origin zip code added too? ;)
Comment #11
longwaveThis could be added to the uc_views project if the Ubercart maintainers are not interested.
Comment #12
5n00py commentedOk, I can add packege quantity to this patch.
Where I can find zip code?
By default "Product information" doesn't have this field.
Comment #13
5n00py commentedSame patch, but now with "package quantity".
Comment #14
3cwebdev commentedi was able to add a shipping origin zip field with the following addition to the same module:
Comment #15
longwavePatch in #13 is a good start. I think it would be good to add a new handler that optionally displays the units, and also a single "dimensions" field that shows all 3 values (and units) in a single Views field.
If the shipping origin fields are also to be added, that should be addressed in a new issue.
Comment #16
longwaveMarked #985702: Add package quantity field in Views as duplicate, as it seems easier to deal with both in one issue.
Comment #17
lpalgarvio commentedyes, please seperate the add to cart button from the quantity field.
Comment #18
arski commentedsubscribing, having package quantities in Views would be a blast!
Comment #19
5n00py commentedTY, longwave! Maybe on this week I could write a handler for dimensions.
Comment #20
akamaus commented5n00py, any progress on #19?
By the way, what are shortcomings of just creating the dimensions field in node with cck?
Comment #21
tr commentedTagging.
Comment #22
longwaveMarked #1279472: Product dimensions (LxWxH) not exposed to viewes? as duplicate
Comment #23
tr commentedLet's take care of this in 7.x-3.x first.
Comment #24
stewart.adam commentedIt would be great to expose the default quantity to add to cart too. Attached patch does this against 6.x-dev (sorry don't have the time to update it against 7.x-dev atm).
Comment #25
LTech commentedIs there a patch to add dimensions to views for drupal 7?
Will it work in panels?
Comment #26
okokokok commentedPatch in #9 works fine for me. Thanks.
Comment #27
extensive commented#9th patch is working fine.
Thanks
Comment #28
longwaveCommitted to 6.x-2.x in http://drupalcode.org/project/ubercart.git/commitdiff/ec7180b
Needs porting to 7.x-3.x
Comment #29
longwavePorted and committed in http://drupalcode.org/project/ubercart.git/commit/eccf02e