I created an catalog_product_save_before observer to update some attributes based on other attributes. Specifically, I use m2epro to update my ebay listings. Sometimes I want ebay to show less in stock than I actually have, so I created 2 new attributies, ebay_qty and ebay_max_qty.
In my observer, I have the following code:
$product = $observer->getEvent()->getProduct(); $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product); $Qty = $stock->getQty(); $EBayQty = $Qty; $MaxQty = $product->getEbayMaxQty(); if (($MaxQty > 0) && ($EBayQty > $MaxQty)) $EBayQty = $MaxQty; $product->setData('ebay_qty', $EBayQty);
This is grabbing the qty currently in the database. How do I get the new Qty about to be saved?