Public Member Functions | |
__construct () | |
getBackordersOption () | |
getStockOption () | |
getProduct () | |
getStockItem () | |
isConfigurable () | |
getFieldValue ($field) | |
getConfigFieldValue ($field) | |
getDefaultConfigValue ($field) | |
isReadonly () | |
isNew () | |
getFieldSuffix () |
Definition at line 32 of file Inventory.php.
__construct | ( | ) |
Constructor
By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes
Reimplemented from Varien_Object.
Definition at line 34 of file Inventory.php.
00035 { 00036 parent::__construct(); 00037 $this->setTemplate('catalog/product/tab/inventory.phtml'); 00038 }
getBackordersOption | ( | ) |
Definition at line 40 of file Inventory.php.
00041 { 00042 return Mage::getSingleton('cataloginventory/source_backorders')->toOptionArray(); 00043 }
getConfigFieldValue | ( | $ | field | ) |
Definition at line 84 of file Inventory.php.
00085 { 00086 if ($this->getStockItem()) { 00087 if ($this->getStockItem()->getData('use_config_' . $field) == 0) { 00088 return $this->getStockItem()->getData($field); 00089 } 00090 } 00091 00092 return Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_ITEM . $field); 00093 }
getDefaultConfigValue | ( | $ | field | ) |
Definition at line 95 of file Inventory.php.
00096 { 00097 return Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_ITEM . $field); 00098 }
getFieldSuffix | ( | ) |
getFieldValue | ( | $ | field | ) |
Definition at line 75 of file Inventory.php.
00076 { 00077 if ($this->getStockItem()) { 00078 return $this->getStockItem()->getDataUsingMethod($field); 00079 } 00080 00081 return Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_ITEM . $field); 00082 }
getProduct | ( | ) |
Definition at line 55 of file Inventory.php.
00056 { 00057 return Mage::registry('product'); 00058 }
getStockItem | ( | ) |
Retrieve Catalog Inventory Stock Item Model
Definition at line 65 of file Inventory.php.
00066 { 00067 return Mage::registry('product')->getStockItem(); 00068 }
getStockOption | ( | ) |
Retrieve stock option array
Definition at line 50 of file Inventory.php.
00051 { 00052 return Mage::getSingleton('cataloginventory/source_stock')->toOptionArray(); 00053 }
isConfigurable | ( | ) |
Definition at line 70 of file Inventory.php.
00071 { 00072 return Mage::registry('product')->isConfigurable(); 00073 }
isNew | ( | ) |
Definition at line 110 of file Inventory.php.
00111 { 00112 if (Mage::registry('product')->getId()) { 00113 return false; 00114 } 00115 return true; 00116 }
isReadonly | ( | ) |
Is readonly stock
Definition at line 105 of file Inventory.php.
00106 { 00107 return $this->getProduct()->getInventoryReadonly(); 00108 }