I did a bulk import into site_content from a CSV file from my client (setting all the new resources to class_key=scProductResource).
Is there a programmatic way of adding these new resources to the scProductMeta table via snippet? I tried creating a new scProductMeta object, but the resource field looks like it can’t be set from a snippet context.
I have around 100 products that were added that need to be associated with the scProductMeta table, so any automated way of doing this would be appreciated.
Originally, I was attempting to set the field values on object construct:
$product = $modx->newObject(‘scProductMeta’, array(‘resource’=>$resource->get('id)));
Breaking it into two steps (create new object first, then set the value via $product->set) seems to have worked.