getQty(); } if (($this->getBackorders() == Mage_CatalogInventory_Model_Stock::BACKORDERS_NO || Mage::helper('aitpreorder')->isPreOrder($this)) && $qty <= $this->getMinQty()) { return false; } return true; } public function verifyNotification($qty = null) { if ($qty === null) { $qty = $this->getQty(); } return (float)$qty < $this->getNotifyStockQty(); }/** * If stock item were not applied with product we will return product id * * @return object|int */ private function _getAitProduct() { $product = $this->getProduct(); if(!$product) { $product = $this->getProductId(); } return $product; }/** * Override parent. Retrieve Stock Availability * * @return bool|int */ public function getIsInStock() { $stock = parent::getIsInStock(); if(!$stock && Mage::helper('aitpreorder')->isBackstockPreorderAllowed($this->_getAitProduct())) { $stock = true; } return $stock; }/** * Override parent. Check quantity * * @param decimal $qty * @exception Mage_Core_Exception * @return bool */ public function checkQty($qty) { $qty = parent::checkQty($qty); if(!$qty && Mage::helper('aitpreorder')->isBackstockPreorderAllowed($this->_getAitProduct())) { $qty = true; } return $qty; }protected function _beforeSave() { // see if quantity is defined for this item type $typeId = $this->getTypeId(); if ($productTypeId = $this->getProductTypeId()) { $typeId = $productTypeId; }$isQty = Mage::helper('catalogInventory')->isQty($typeId);if ($isQty) { if (!$this->verifyStock()) { if($this->getBackorders() == Aitoc_Aitpreorder_Model_Rewrite_SourceBackorders::BACKORDERS_YES_PREORDERS_ZERO) { $preorder = 1; }$this->setIsInStock(false) ->setStockStatusChangedAutomaticallyFlag(true); } elseif($this->getBackorders() == Aitoc_Aitpreorder_Model_Rewrite_SourceBackorders::BACKORDERS_YES_PREORDERS_ZERO) { $preorder = 0; }if(isset($preorder)) { $product = Mage::getModel('catalog/product')->load($this->getProductId()); $preorderProduct = $product->getPreorder(); if(!isset($preorderProduct) || $preorderProduct != $preorder) { $product->setStoreId(0)->setPreorder($preorder); $product->getResource()->saveAttribute($product, 'preorder'); } }// if qty is below notify qty, update the low stock date to today date otherwise set null $this->setLowStockDate(null); if ($this->verifyNotification()) { $this->setLowStockDate(Mage::app()->getLocale()->date(null, null, null, false) ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT) ); }$this->setStockStatusChangedAutomatically(0); if ($this->hasStockStatusChangedAutomaticallyFlag()) { $this->setStockStatusChangedAutomatically((int)$this->getStockStatusChangedAutomaticallyFlag()); } } else { $this->setQty(0); }//return $this; return parent::_beforeSave(); } }/** * Innoexts * * NOTICE OF LoadAvailableByProduct($product); } else { $this->loadByProduct($product); } if (!$this->getId()) { $this->addData($this->getDefaultData()); } } $this->setProduct($product); $product->setStockItem($this); $product->setIsInStock($this->getIsInStock()); $stockStatus->assignProduct($product, $this->getStockId(), $this->getStockStatus()); $productPriceHelper->applyPrices($product); return $this; } /** * Get maximal stock quantity * * @param float $origQty * @return float */ public function getMaxStockQty($origQty) { $qty = $this->getQty(); if ($qty > $origQty) { $qty = $origQty; } if (!$this->getManageStock()) { return $qty; } if (!$this->getIsInStock()) { return false; } if (!is_numeric($qty)) { $qty = Mage::app()->getLocale()->getNumber($qty); } if (!$this->getIsQtyDecimal()) { $qty = (int) $qty; } $qtyIncrements = $this->getQtyIncrements(); if (!$qtyIncrements){ $qtyIncrements = $this->getDefaultQtyIncrements(); } if ($qtyIncrements && ($qty % $qtyIncrements != 0)) { $qty = floor($qty / $qtyIncrements) * $qtyIncrements; } if ($this->getMinSaleQty() && ($qty < $this->getMinSaleQty())) { return false; } if ($this->getMaxSaleQty() && ($qty > $this->getMaxSaleQty())) { $qty = $this->getMaxSaleQty(); } if (!$qty) { return false; } return $qty; } /** * Returns product instance * * @return Mage_Catalog_Model_Product|null */ public function getProduct() { return $this->_productInstance ? $this->_productInstance : $this->_getData('product'); } }
Set Descending Direction
per page

4 Item(s)

Grid  List 

Set Descending Direction
per page

4 Item(s)

Grid  List 

Shop By
Currently Shopping by:
  1. Remove This Item Engine Arrangement: 116-7959
  2. Remove This Item Engine Arrangement: 116-8670
  3. Remove This Item Engine Arrangement: 291-9259
  4. Remove This Item Engine Arrangement: 267-5965
  5. Remove This Item Engine Arrangement: 351-0216
  6. Remove This Item Engine Model: C-13
Shopping Options
Engine Arrangement
  1. - (1)
  2. 291-9259 (2)
  3. 267-5965 (2)
Engine Model
  1. 3116 (1)
  2. 3126 (1)
  3. C-13 (4)
  4. C-27 (1)
Compare Products

You have no items to compare.