当前位置: 首页>>代码示例>>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;未经允许,请勿转载。