Let admin push class attribute/option changes out to existing nodes

webchick - August 22, 2008 - 00:03
Project:Ubercart
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:drupalprojects
Status:reviewed & tested by the community
Issue tags:Usability
Description

Specifying select boxes or radio buttons has zero effect.

#1

webchick - August 22, 2008 - 00:13
Category:bug report» support request
Status:active» closed

My mistake. I had specified the options at the global level, not at the product level.

#2

webchick - August 22, 2008 - 00:14
Category:support request» bug report

Well, come to think of it, refiling as a bug report. It ought to display a message or something if the global attribute settings have options but this product doesn't. I only happened upon this by debugging the code.

#3

webchick - August 22, 2008 - 00:14
Status:closed» active

#4

Island Usurper - September 2, 2008 - 20:35

Do you think this should be a constant message, or just a one-time notice that appears when the product's attribute form is submitted? I don't know if anyone actually does it, but it's conceivable for someone to intentionally leave off the product options because they want the text field for that product.

#5

webchick - September 3, 2008 - 00:12

I would say check them all by default, and let me *un*check them if there's some I don't want as options. That'd make the most sense in my use case anyway. I'm not sure what people are doing with attributes on a normal basis.

#6

nlindley - September 8, 2008 - 12:59

I agree. For what I do it is much easier to uncheck the items that are not used. Since people have already set certain options for the attributes, I think they would expect them to by enabled by default for that attribute.

#7

keva - September 11, 2008 - 17:59

I agree that having the options checked by default would be a big time-saver and it makes sense for my purposes.

#8

aburda - October 6, 2008 - 12:37

I've got the same problem, although I don't seem to be able to resolve it either at a global level for the attribute or at a specific level for the individual product. Both are set to Drop down box and I end up with a text field.

#9

rszrama - October 7, 2008 - 19:49
Title:Attributes always show as text fields» Let admin push class attribute/option changes out to existing nodes
Category:bug report» feature request
Status:active» needs review

I'm going to reassign this issue b/c it's more a feature request now than a bug report. I like the idea of having global defaults that get pushed out to products, though it sounds like there was some interest in changing the way options work by default. The attached patch can be a beginning to addressing the situation... it allows you to do this for D6, and we can see if cha0s can re-roll it to change it so options are enabled by default. This patch itself needs testing, too.

(Pasted from http://www.ubercart.org/forum/support/6321/refresh_all_products_after_ad....)

#10

Island Usurper - October 27, 2008 - 18:58

webchick, your feature request in #5 has been granted as of #326352-6: Document Enabling Product Attributes. I decided it was the most common use case, but it's not really part of this issue's scope. Perhaps it will alleviate it some.

#11

cha0s - October 29, 2008 - 02:29

I'm not 100% sure on this, and Eaton would know better than me (cause he was the one giving the talk at DCC) but I think that views2 administrative actions (I can't even remember the name for certain ... still gotta get my notebook I left down there :P) will allow us to do things like this, like batch operations modifying some aspect of a node. We probably just have to define some action to views to allow that.

#12

Island Usurper - December 10, 2008 - 18:51
Status:needs review» needs work

Wanted to post the patch since the discussion has moved here.

I'm marking it as CNW because Postgres doesn't have any way to do ON DUPLICATE KEY UPDATE. Even though the update doesn't do anything, there isn't even INSERT IGNORE available.

The comment next to the default option raises an interesting problem. Should there be a similar mechanism to push options out to the products as well? I'm starting to realize the serious limitations of the API. As is, you still have to go to each product to enable all of the options for the attribute, even though this is taken care of when the attribute is added to the product through the form.

AttachmentSize
uc_attribute-push-to-product-class.module.patch 4.9 KB

#13

rszrama - February 6, 2009 - 18:53

I think I have a more recent version of this patch here.

AttachmentSize
uc_attribute-push-to-product-class.module.patch 4.9 KB

#14

sokrplare_10 - February 14, 2009 - 04:24

Patch was great, but uc_attribute.module has changed a lot since then. I tried merging a patched version of the file with the latest, but far more has changed than I am familiar with. Can someone else who is more familiar with this module give it a shot? Would be most appreciated!

Thanks!

.:Joshua

#15

Island Usurper - February 17, 2009 - 13:35
Assigned to:Anonymous» Island Usurper

#16

rszrama - June 29, 2009 - 18:38
Status:needs work» postponed

#17

marc.groth - October 23, 2009 - 19:37

I'd be very interested in this functionality as I have literally thousands of products and it will be a major headache going into each and every product to add the attributes for each!

I tried downloading the latest version of dev and applied the patch (manually, automatically didn't work as with Joshua) and I got the checkbox that says "Push this attribute to these product classes"... But for some reason even when I ticked this it didn't work?

Here are the steps I took:

  1. Created a product type (class)
  2. Created a new product (node/add) of that product type
  3. Went to the attributes and added an attribute "Flavour"
  4. Ticked the new class under "Push this attribute to these product classes" and submitted the form
  5. Added options for the "Flavour" attribute
  6. Went to the product (node) for the new product type but no "Flavour" dropdown was present
  7. Clicked the product type (class) attributes and noticed no "Flavour" attribute there already either (I guess which is why the product itself had no dropdown)

Did I miss something? I have a feeling I have... But can't think what? I also tried adding an attribute directly for the product type and selected the "Push this attribute..." but that didn't do anything either.

Any ideas?

By the way I'd be more than happy to help test (and even contribute if I can get my head around the code ;)) any patches etc... So let me know if there are any further steps I can take to help get this feature on the go! :)

Thanks :)

#18

drupalprojects - November 5, 2009 - 09:48

Attaching new patch.

Some documentation:
This patch will allow to flush products attributes. Under flush I mean that product attribute settings set on node level will be ERASED and then class settings will be applied/

  • BACKUP your database & files
  • Apply patch
  • FLUSH CACHE
  • Edit any product class and set necessary attributes with options
  • Patch should add "Bulk" tab when you're on class edit pages
  • Click on bulk menu item
  • Check products you want to flush
AttachmentSize
uc_attribute.patch 5.04 KB

#19

drupalprojects - November 5, 2009 - 10:21
Assigned to:Island Usurper» drupalprojects

#20

marc.groth - November 6, 2009 - 21:35
Status:postponed» reviewed & tested by the community

drupalprojects,

Thank you SO MUCH for this patch!! It worked perfectly for me. Absolutely great and just how I imagined/hoped it would work!! The only issue is that I couldn't actually apply the patch automatically (I'm using TortoiseSVN) but by applying it manually everything seemed to transfer over so thanks!!

Setting the status of this to "reviewed & tested by the community" however if anyone has any issues with the patch then feel free to change it.

Hoping this can get adopted soon :)

#21

entrepenerd - November 20, 2009 - 04:02

This worked fantastic for me also. As already mentioned, I needed to manually apply the patch, but that was probably more of an issue with my environment than the patch file. Thanks so much. This has saved me a ton of time.

#22

hedac - November 21, 2009 - 21:53

This patch #18 is absolutelly brilliant and perfect
This must be committed into ubercart.
Thank you very much !!!

 
 

Drupal is a registered trademark of Dries Buytaert.