i have a site that sells memberships using ubercart, and the one product has an attribute (drop down) so the customer can pick which "group" they are joining.
when I create a group (organic groups using a node type called Group), I want to also add a value to the pull down in the product with that group name.
so I was going to do something like make a rule. on create content, type = Group, execute php
and in the php, I was going to put the code to add an option to the attribute, instead of having to go to admin/store/attributes/2/options/add and do it as a human
I'm importing 60 Groups, and creating the group nodes ok. and I'd like to set up the options programmatically too. And each time I do an import, I'll have to do it again, so it makes sense to set this up. Also, I'll be passing on the admin of the site to others, and it is easier for them to just "create a group". I'll have a hard time getting them to remember to go into the store admin and find the place to add an option to an attribute. They are just going to want to "create a group" (which is just a node) and fill out that form and have the pull down option on the product magically have the name of the new group listed there.
so I figure I could populate some kind of array like mynewoption->name="The name"; mynewoption->price=0; mynewoption->cost=0;
then uc_attribute_option_add($mynewoption)
... but I dont know how to find out what the function is called, or what the structure needs to look like.
I just know the page to do it as a human is admin/store/attributes/2/options/add
I've looked at the documentation api examples http://www.ubercart.org/docs/api
and it might be there... but I dont know for sure what I'm looking for.
I also looked in the code
http://drupalcode.org/viewvc/drupal/contributions/modules/ubercart/uc_at...
and
http://drupalcode.org/viewvc/drupal/contributions/modules/ubercart/uc_at...
How do I do this? How do I find where the info I need is, and maybe the answer is out there... but I'm not googling for the right thing...
Thanks for any leads.
ps. (this is related to: http://www.ubercart.org/forum/support/15829/practical_advice_setting_lar...)

