Skip to content

Instantly share code, notes, and snippets.

@drewgillson
Created April 16, 2013 11:09
Show Gist options
  • Save drewgillson/5395114 to your computer and use it in GitHub Desktop.
Save drewgillson/5395114 to your computer and use it in GitHub Desktop.
<?php
class Lot_Common_Helper_Cli_Erp extends Lot_Common_Helper_Cli_Data {
public function refreshStockStatusAsync($entity_ids) {
foreach ($entity_ids as $entity_id) {
try {
Mage::helper('SalesOrderPlanning/ProductAvailabilityStatus')->RefreshForOneProduct($entity_id);
Mage::helper('AdvancedStock/Product_Base')->updateStocksFromProductId($entity_id);
Mage::helper('purchase/Product')->updateProductWaitingForDeliveryQty($entity_id);
Mage::helper('purchase/Product')->updateProductDeliveryDate($entity_id);
}
catch (PDOException $e) {
echo "Product with entity_id $entity_id was unable to be refreshed because of a MySQL exception";
echo $e->getMessage();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment