I have to import some products into OC. I have a file named import.php. I can do the import if I make a file controller/catalog/import.php, but how do I have access to ->model_catalog_product->addProduct($productData); from a file that is not loaded as a controller (a totally new file).
At the moment I have this:
Code: Select all
include('./config.php');
require_once(DIR_SYSTEM . 'startup.php');
$registry = new Registry();
$productData = array(
'name' => 'Product Name Here',
'model' => 'ABC123',
);
// Attempt to pass the assoc array to the add Product method
$x = $registry->model_catalog_product->addProduct($productData);