コード例 #1
0
 /**
  * prepare stock
  *
  * @return Shopgate_Model_Catalog_Stock
  */
 protected function prepareStock()
 {
     $stockItem = new Shopgate_Model_Catalog_Stock();
     $stockItem->setMinimumOrderQuantity($this->currentProduct->minimal_quantity > 1 ? $this->currentProduct->minimal_quantity : 0);
     $stockItem->setUseStock($this->currentProduct->depends_on_stock);
     $stockItem->setStockQuantity($this->currentProduct->quantity);
     $stockItem->setIsSaleable($this->prepareIsSaleable($this->currentProduct, $stockItem->getStockQuantity()));
     $stockItem->setAvailabilityText($this->prepareAvailableText($stockItem->getIsSaleable(), $stockItem->getStockQuantity(), $this->currentProduct->out_of_stock));
     return $stockItem;
 }