I have Socialengine with Store Plugin.... I want to create a product in store programatically(Not using GUI and Not using Admin Panel) from an other module like events.
Steps 1. Get the owner_id from viewer 2. Query for store_id from "sitestore_stores" table 3. Create an array having all the fields like in table "sitestoreproduct_product" 4. get the Adapter
$table = Engine_Api::_()->getItemTable('sitestoreproduct_product');
$db = $table->getAdapter();
$db->beginTransaction();
Create Row and set the created array and then save
$sitestoreproduct = $table->createRow();
$sitestoreproduct->setFromArray($values);
$sitestoreproduct->save();
Finally Commit the Database.