/** * Given a product_id and vendor_id * will perform a full CSV reconciliation of the _productquantities table * * @param $product_id * @param $vendor_id * @param $attributeOptionId * @return unknown_type */ static function doProductQuantitiesReconciliation($product_id, $vendor_id = '0', $attributeOptionId = '0') { if (empty($product_id)) { return false; } $csvs = TiendaHelperProduct::getProductAttributeCSVs($product_id, $attributeOptionId); JModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tienda/models'); $model = JModel::getInstance('ProductQuantities', 'TiendaModel'); $model->setState('filter_productid', $product_id); $model->setState('filter_vendorid', $vendor_id); $items = $model->getList(); $results = TiendaHelperProduct::reconcileProductAttributeCSVs($product_id, $vendor_id, $items, $csvs); }