It seems that we need to expose the product information to CCK somehow. The location of fields on forms is now all jacked up, and if you adjust that with some drag-n-drop on the manage fields page, the rendering of product nodes switches around so all the custom product fields are beneath the node body.

Comments

rszrama’s picture

Island Usurper’s picture

Status: Active » Fixed

Added product information as extra "fields" to CCK. Since uc_product was adjusting the weight of the body field, that also was altered from where CCK had put it. The Manage Fields tab for the Product content type(s) really only affects the Product information fieldset on the node form. The Product fields settings page is still the place to adjust the order of those fields on the View tab.

Status: Fixed » Closed (fixed)

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

jm.federico’s picture

StatusFileSize
new1.65 KB

Hi, old post, but decided it is better to re-open something instead of creating new-duplicated issues.

Here is a patch to be able to set the order in which the fields are rendered using CCK "manage field" interface.

It exposes all the fields available at the "product manage fields" setting page for each node type that is a product.

It would be great if this happens in future versions of Ubercart

Cheers

webservant316’s picture

Title: Review integration with CCK » Field weight order using CCK interface
Version: 6.x-2.x-dev » 6.x-2.2
Category: task » feature
Status: Closed (fixed) » Active

I installed this patch, but the product node CCK field display order seems uneffected. Though I rearrange them the view display does not change. Further your note above suggests that the fields would be exposed in the store>configure>product area, but they are not exposed there but at the 'manage fields' area.

Do I understand your patch properly?

jm.federico’s picture

@webmaster_prwa
I didn't express my self correctly, here I go:

What the patch does is it exposes each field from ubercart into the "manage fields" interface for each node type that is a product.
If you have admin menu:
Content Management > Content Types > Edit -node type- > Manage Fields

This way you do not have to to go to the store admin interface to rearrange them, which makes sense, because now you do not have to guess the weight of the fields, and it all happens in one place. And not only that, you can set them for each product type that you have.

Hope that clarify things.

Federico

webservant316’s picture

Thanks, I'll try the patch again. However, I think the first time I tried it
I found the fields exposed in 'Manage Fields' as you say more cleary.
However, when I rearranged the fields there, the display order on the
node page was uneffected.

Jeff

webservant316’s picture

Just installed this patch a second time and I see the ubercart product fileds over in Content Management > Content Types > Edit -node type- > Manage Fields. However, when I move the fields around the product node display field order is uneffected.

jm.federico’s picture

hum, that is strange, which fields are you changing?
Keep in mind that with Ubercart the body fields is not used anymore, and the Description field takes its place.

What version of CCK, Ubercart, and Drupal are you using?

Do you have any debugging tool? If not, I would recommend firebug (http://getfirebug.com/) + drupal for firebug (http://drupal.org/project/drupalforfirebug) (https://addons.mozilla.org/en-US/firefox/addon/8370/)

With this you can check the fields weight after they are rendered in your node page (http://yourdomain.com/node/###)
If you get those tools, check the weight for each field under #content_extra_fields
then go and shuffle them around and recheck the weights.

If they change then there must be something messing your display, if they do not change, I would be completely clueless.

Let me know what you find.

Federico

webservant316’s picture

Working now.
Moved to Zen theme for unrelated reasons.
Your product field ordering works with Zen but not with Zeropoint.
No doubt Zeropoint is making a mistake.
Thanks for this module.
Very helpful to me!

jm.federico’s picture

Version: 6.x-2.2 » 6.x-2.4
Status: Active » Needs review
StatusFileSize
new1.73 KB

Attaching patch against 6.x-2.4

KennyVanLent’s picture

Status: Needs review » Reviewed & tested by the community

Have added this code, works perfect first time. Perfect code.
But is their a possibility to add a Configure and Delete? Meaning, full control through CCK?
Please let me know :)

Thank you :)

jm.federico’s picture

@Kenny van Lent
I don't really get what you mean with configure and delete.

I'm guessing you refer to the options you get with fields created using CCK, where you can remove them, or add them from the same interface?
If that is the case, it is not possible, these fields are created by Ubercart, and Ubercart is responsable for showing them or not, all this does is lets us change the weight in a more coherent way, rather thann having to go to Ubercart's interface and guess what weights are the ones we need.

Basically what happens here is that Ubercart will set the weights according to its settings, then CCK will override them. That's all the patch does.

Cheers

Federico

SeanA’s picture

Thanks for this useful code. +1 for this getting added to Ubercart.

Volx’s picture

StatusFileSize
new4.18 KB

Good patch! The way it works right now is really confusing for someone who is used to cck to order the fields. Since the actual weights are never exposed to the user, having to guess the values for the product fields is really annoying and error prone. Moreover it is not reliable, since rearranging the cck field order changes the weights intransparently.

The patch above works like a charm. I took it and went a little bit further by removing the list position field from the admin/store/settings/products/edit/fields form. Since the list position within that form has no function anymore, it only confuses the user. This of course happens only when cck's content module is enabled.

smscotten’s picture

This is more than useful: it's really important integration, especially because the weights of CCK fields can be anywhere from -50 to 50 (and aren't set numerically by the user) whereas the weights of Ubercart product fields can only be set between -10 and 10. Without this patch (or forcing the matter by hard-coding the fields into a theme file) there is no way to put fields in any order.

Thank you JM and Volx!

Island Usurper’s picture

Status: Reviewed & tested by the community » Needs work

Is there a way to keep the existing order of the fields from changing when this patch is applied? While it's now easy to fix the problem, I'd rather not make everybody go back in to their field settings and put everything back the way they want them just because they updated Ubercart.

It might be unavoidable, but I'm hoping someone comes up with an idea first.

SeanA’s picture

Version: 6.x-2.4 » 6.x-2.6
Status: Needs work » Needs review
StatusFileSize
new4.85 KB

Here's #15 reworked so the existing field order is retained.

Status: Needs review » Needs work

The last submitted patch, ubercart-333085-18.patch, failed testing.

SeanA’s picture

Status: Needs work » Needs review
StatusFileSize
new4.85 KB

Argh. =/ Same patch, renamed.

kuydigital’s picture

Where should I apply this patch?

tr’s picture

Version: 6.x-2.6 » 6.x-2.x-dev
Status: Needs review » Needs work

Let's see what the testbot has to say. Bot will ignore patch in #20 because it has that _D6 at the end of the name, but @SeanA says #18 is the same ...

tr’s picture

Status: Needs work » Needs review
tr’s picture

#18: ubercart-333085-18.patch queued for re-testing.

webservant316’s picture

Glad to see this patch making it into Ubercart. Thanks!

webservant316’s picture

I see this patch is still not applied to Ubercart 2.7. I am upgrading to 2.7 and so am rolling the patch forward manually in my own install... again.

Note that I am still using the patch in #4, though the line numbering / placement in the module had migrated since the original patch. The patch in #4 works and meets my needs, even though the notes above say that it failed unit testing. There seem to be better patches following, but they also appear to be more complicated and also fail unit testing. I am reluctant to test any of the later patched because #4 does work for me and I am just too busy these days.

Hoping to get more community action on this issue and help from Ubercart experts. It still seems surprising that this patch hasn't made it into the module. Doesn't anyone reorder their Ubercart product fields with CCK fields present? This seems to be an essential feature to me. I am tempted to change the priority to 'major' in hopes of getting more serious help with this issue.

Ubercart is a great module and our business depends upon it. Thank you for your efforts to improve it.

SeanA’s picture

If you'd like to see this get into Ubercart, please apply the latest patch and test it (and post a patch for 2.7 if you can). It's an improvement over the original and doesn't add anything really complicated or that can be considered harmful, mostly it's just setting default values and it also checks to see if CCK module is present before applying the weights.

webservant316’s picture

ok - here is the latest patch recast for Ubercart 2.7.

I have applied the patch to the code and plan to test this week. I will report back.

The patch format is from TortoiseSVN. Sorry if that doesn't pass muster, someone else will need to help. I've also attached the changed 2.7 files (with a '.txt' extension so I could attached them) with the patch applied if that helps anyone to make a better patch file.

Status: Needs review » Needs work

The last submitted patch, ubercart-6.x-2.7-333085-28.patch, failed testing.

webservant316’s picture

My apologies for tarnishing this effort. No doubt the TortoiseSVN patch format failed the test. I am pretty sure the changes are properly applied to the two files above. If someone with better tools could make the patch file it would be greatly appreciated. I would love for this to get into the next version of Ubercart.

webservant316’s picture

no dice on the later patch for me. I am sticking with the original one for now. The later patch does not seem to respect the CCK field ordering when editing the product node. Whoever ever wrote or understands the improved patch is going to have to invest some effort and re-post.

webservant316’s picture

further testing today.

the simple patch at the top of this issue continues to work for re-ordering fields on a product node both in view and edit mode. not sure what the issue is with the improved patches. I thought perhaps my upgrade to Ubercart 2.7 was causing both patches to not properly order the fields when in edit mode, but no. the initial patch works for view and edit, but the last patch only works for view and not for edit. also note that the 'product information' block of fields stubbornly stays at the top of the edit page and other fields stay put and I cannot move them. perhaps @SeanA can help us out.

SeanA’s picture

Status: Needs work » Needs review
StatusFileSize
new4.24 KB

You're right, there was a problem. This one should work. The default weights are set the same as Ubercart, and can be overridden on Content type -> Manage fields.

webservant316’s picture

performance of the #33 patch still not quite right. still works completely when viewing node. field order is also responds to changes and properly reflected when editing a node, EXCEPT for the 'product information' block of fields still insists on being top most on the form. It is a little weird not to be able to list the node title on the top, plus it seems like the patch should at least leave the field placements where they were. Can't really move to this patch as the field order when editing a node would be disconcerting to my users.

webservant316’s picture

FYI - I am still depending on this patch and just manually installed it in Ubercart 2.9 for my install.
Also the later patches still do not work for me, so still using #4.

sdowney2002’s picture

#18: ubercart-333085-18.patch queued for re-testing.

longwave’s picture

Status: Needs review » Closed (won't fix)

This has been hanging around a very long time, but changing this now on all 20,000+ existing 6.x installs is just likely to confuse people more than anything. New sites should be on 7.x where this has long since been changed. As per #1903564: [policy] Maintenance phase for 6.x-2.x branch we are not accepting new features on 6.x any longer.