I would like to make a custom import XML script, to load external data from a custom software. This software only send xml data to the webshops.
It is ok, but I would like to store an external ID in commerce (what is searchable).
I tried that:
$product = commerce_product_new('product');
$product->product_id = $sid; // $sid is the external ID
but it doesn't work. The product_id is an internal ID, it is not modified.
I created custom field in "product types": field_sid
But how can I search in this field? I can search in SKU field with commerce_product_load_by_sku() function.