Discussions

Populate Commerce File fields programatically

Hello-
I have followed the following example and it works well, is it possible to populate the product fields as well? For example, I have the code below creating a product which has a commerce file field attached. I would like to populate this field with my file location on the fly. (instead of uploading) The goal is automated product/display creation for the user. Is that possible? Thanks for your time. :)

http://drupal.stackexchange.com/questions/23168/commerce-product-program...

Posted: Apr 18, 2012

Comments

jon-pierre on April 18, 2012

I have found a new idea, to use File Field Sources to allow files from the server, which works great. Is there a way to populate the attach fields when building a product programatically?