Example #1
0
 /**
  * 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 = CitruscartHelperProduct::getProductAttributeCSVs($product_id, $attributeOptionId);
     JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_citruscart/models');
     $model = JModelLegacy::getInstance('ProductQuantities', 'CitruscartModel');
     $model->setState('filter_productid', $product_id);
     $model->setState('filter_vendorid', $vendor_id);
     $items = $model->getList();
     $results = CitruscartHelperProduct::reconcileProductAttributeCSVs($product_id, $vendor_id, $items, $csvs);
 }