Automating product creation/updating
As I write this I'm trying to chew my way through the API docs, but I'm not having much luck stringing the parts together that I need, so I hope somebody can help a bit.
My intention is to sync products in my DC catalogue from an external data source (so all products are created and modified programmatically based on that data). The code to update the catalogue would run via cron. There will just be one SKU per product display.
Having drilled into it a little, I see I can use commerce_product_new() to create a new instance of a given product type, but a completed product (created through the UI) has many other fields such as price, images, and other fields that have been added to the variation type. Also of course this is just a SKU/Product Variation (just about got my head round the nomenclature now, I think), so a Product Display
has to be created at the same time, which has its own fields (title, body).
Can this realistically be done programmatically, or am I better off just attacking the database directly? (I'd certainly rather just use "blessed" api methods if they're available, but I'll go the hackish route if there's no other option.)
Any advice/tips would be welcome, as this is altogether to wordy to usefully google for!