當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Mage_Catalog_Model_Product::isAvailable方法代碼示例

本文整理匯總了PHP中Mage_Catalog_Model_Product::isAvailable方法的典型用法代碼示例。如果您正苦於以下問題:PHP Mage_Catalog_Model_Product::isAvailable方法的具體用法?PHP Mage_Catalog_Model_Product::isAvailable怎麽用?PHP Mage_Catalog_Model_Product::isAvailable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Mage_Catalog_Model_Product的用法示例。


在下文中一共展示了Mage_Catalog_Model_Product::isAvailable方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: prepareStockAlertData

 /**
  * Check whether the stock alert data can be shown and prepare related data
  *
  * @return void
  */
 public function prepareStockAlertData()
 {
     if (!$this->_getHelper()->isStockAlertAllowed() || !$this->_product || $this->_product->isAvailable()) {
         $this->setTemplate('');
         return;
     }
     $this->setSignupUrl($this->_getHelper()->getSaveUrl('stock'));
 }
開發者ID:hyhoocchan,項目名稱:mage-local,代碼行數:13,代碼來源:View.php

示例2: prepareStockAlertData

 /**
  * Check whether the stock alert data can be shown and prepare related data
  */
 public function prepareStockAlertData()
 {
     if (!Mage::getStoreConfigFlag(Mage_ProductAlert_Model_Observer::XML_PATH_STOCK_ALLOW) || !$this->_product || $this->_product->isAvailable()) {
         $this->setTemplate('');
         return;
     }
     $this->setSignupUrl(Mage::helper('productalert')->getSaveUrl('stock'));
 }
開發者ID:hirentricore,項目名稱:devmagento,代碼行數:11,代碼來源:View.php

示例3: prepareStockAlertData

 /**
  * Check whether the stock alert data can be shown and prepare related data
  *
  * @return void
  */
 public function prepareStockAlertData()
 {
     $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($this->_product);
     if (!$this->_getHelper()->isStockAlertAllowed() || !$this->_product || $this->_product->isAvailable() || $stock->getQty() != 0) {
         $this->setTemplate('');
         return;
     }
     $this->setSignupUrl($this->_getHelper()->getSaveUrl('stock'));
 }
開發者ID:santhosh400,項目名稱:ecart,代碼行數:14,代碼來源:View.php

示例4: testIsSalable

 /**
  * @covers Mage_Catalog_Model_Product::isSalable
  * @covers Mage_Catalog_Model_Product::isSaleable
  * @covers Mage_Catalog_Model_Product::isAvailable
  * @covers Mage_Catalog_Model_Product::isInStock
  */
 public function testIsSalable()
 {
     $this->_model->load(1);
     // fixture
     $this->assertTrue((bool) $this->_model->isSalable());
     $this->assertTrue((bool) $this->_model->isSaleable());
     $this->assertTrue((bool) $this->_model->isAvailable());
     $this->assertTrue($this->_model->isInStock());
     $this->_model->setStatus(0);
     $this->assertFalse((bool) $this->_model->isSalable());
     $this->assertFalse((bool) $this->_model->isSaleable());
     $this->assertFalse((bool) $this->_model->isAvailable());
     $this->assertFalse($this->_model->isInStock());
 }
開發者ID:nemphys,項目名稱:magento2,代碼行數:20,代碼來源:ProductTest.php

示例5: getProductData

 /**
  * Create Product array from Mage_Catalog_Model_Product
  *
  * @param Mage_Catalog_Model_Product $product
  * @return array
  */
 public function getProductData(Mage_Catalog_Model_Product $product)
 {
     try {
         $data = array('url' => $product->getProductUrl(), 'title' => htmlspecialchars($product->getName()), 'spider' => 1, 'price' => $product->getPrice(), 'description' => urlencode($product->getDescription()), 'tags' => htmlspecialchars($product->getMetaKeyword()), 'images' => array(), 'vars' => array('sku' => $product->getSku(), 'storeId' => '', 'typeId' => $product->getTypeId(), 'status' => $product->getStatus(), 'categoryId' => $product->getCategoryId(), 'categoryIds' => $product->getCategoryIds(), 'websiteIds' => $product->getWebsiteIds(), 'storeIds' => $product->getStoreIds(), 'groupPrice' => $product->getGroupPrice(), 'formatedPrice' => $product->getFormatedPrice(), 'calculatedFinalPrice' => $product->getCalculatedFinalPrice(), 'minimalPrice' => $product->getMinimalPrice(), 'specialPrice' => $product->getSpecialPrice(), 'specialFromDate' => $product->getSpecialFromDate(), 'specialToDate' => $product->getSpecialToDate(), 'relatedProductIds' => $product->getRelatedProductIds(), 'upSellProductIds' => $product->getUpSellProductIds(), 'getCrossSellProductIds' => $product->getCrossSellProductIds(), 'isSuperGroup' => $product->isSuperGroup(), 'isGrouped' => $product->isGrouped(), 'isConfigurable' => $product->isConfigurable(), 'isSuper' => $product->isSuper(), 'isSalable' => $product->isSalable(), 'isAvailable' => $product->isAvailable(), 'isVirtual' => $product->isVirtual(), 'isRecurring' => $product->isRecurring(), 'isInStock' => $product->isInStock(), 'weight' => $product->getSku()));
         // Add product images
         if (self::validateProductImage($product->getImage())) {
             $data['images']['full'] = array("url" => $product->getImageUrl());
         }
         if (self::validateProductImage($product->getSmallImage())) {
             $data['images']['smallImage'] = array("url" => $product->getSmallImageUrl($width = 88, $height = 77));
         }
         if (self::validateProductImage($product->getThumbnail())) {
             $data['images']['thumb'] = array("url" => $product->getThumbnailUrl($width = 75, $height = 75));
         }
         return $data;
         return $data;
     } catch (Exception $e) {
         Mage::logException($e);
     }
 }
開發者ID:xiaoguizhidao,項目名稱:sailthru-magento-extension,代碼行數:26,代碼來源:Content.php

示例6: canConfigure

 /**
  * Check if product can be configured
  *
  * @param Mage_Catalog_Model_Product $product
  * @return bool
  */
 public function canConfigure($product = null)
 {
     return $product instanceof Mage_Catalog_Model_Product && $product->isAvailable() && parent::canConfigure();
 }
開發者ID:shebin512,項目名稱:Magento_Zoff,代碼行數:10,代碼來源:Type.php

示例7: buildAvailability

 /**
  * Builds the availability for the product.
  *
  * @param Mage_Catalog_Model_Product $product the product model.
  *
  * @return string
  */
 protected function buildAvailability(Mage_Catalog_Model_Product $product)
 {
     $availability = self::OUT_OF_STOCK;
     if (!$product->isVisibleInSiteVisibility()) {
         $availability = self::INVISIBLE;
     } elseif ($product->isAvailable()) {
         $availability = self::IN_STOCK;
     }
     return $availability;
 }
開發者ID:nosto,項目名稱:nosto-magento-extension,代碼行數:17,代碼來源:Product.php


注:本文中的Mage_Catalog_Model_Product::isAvailable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。