Attempting to pre-select an attribute for a particular product and can't seem to make it work, (even on a simple textfield attribute -- ultimately need to select a value from a listbox but keeping it simple till i get it working). Can anyone experienced shed some light on this?

http://www.example.com/my-product?edit[attributes][2][1][value]=test

is not working when the definition of the textarea looks like this:

<input type="text" maxlength="128" name="attributes[2]" id="edit-attributes-2-1" size="60" value="" class="form-text" />

Either I have this wrong, or it just isn't going to work. Thoughts? Thanks!!!!

Cheers,
j

Comments

jruberto’s picture

Status: Active » Closed (fixed)

okay, a few deep breaths and some careful reading of the documentation got me there. for the example above the magic URL was:

http://www.example.com/my-product?edit[attributes][2]=test

Toon Huysmans’s picture

Version: 6.x-1.1 » 6.x-2.0
Status: Closed (fixed) » Active

Hmm, this does not seem to work in my case.

I can prepopulate the quantity field with '5' using: http://www.example.com?q=node/18&edit[qty]=5
where the definition of the element looks like:
<input type="text" class="form-text" value="5" size="5" id="edit-qty" name="qty" maxlength="6">

A similar approach to populate the first attribute, unfortunately, does not work in my case: http://www.example.com?q=node/18&edit[attributes][1]=text
where the definition of the element looks like:
<input type="text" class="form-text" value="" size="60" id="edit-attributes-1" name="attributes[1]" maxlength="128">

How can I figure out which keys I have to use to address this attribute in the url? Thanks!

Toon Huysmans’s picture

Ah, update to 6.x-2.x-dev solves the issue. Great!

Stomper’s picture

I have created a user location field in a custom content_profile CCK form. I also have a location field in the custom product class form for UberCart. I would like to prepopulate the location field (product form) with the information from the location field in the content_profile form.

Would it also be possible to have a checkbox or radio button that would allow the user to "Click to use current location information (prepopulate)" or "Other" which would allow users to enter different location information?

Being able to display the location information on the product page as well as use them in views would be beneficial too.

wylbur’s picture

Prepopulate fills in forms from the URL. Is that what you are trying to do? You could create two links, one with the prepopulate fields, and one without.

Stomper’s picture

I'm not prepopulating from a URL technically, just using content from one field to populate another from different content types.

scuba_fly’s picture

Issue summary: View changes
Status: Active » Closed (outdated)