当前位置: 首页>>代码示例>>PHP>>正文


PHP ProductDownload::isFeatureActive方法代码示例

本文整理汇总了PHP中ProductDownload::isFeatureActive方法的典型用法代码示例。如果您正苦于以下问题:PHP ProductDownload::isFeatureActive方法的具体用法?PHP ProductDownload::isFeatureActive怎么用?PHP ProductDownload::isFeatureActive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProductDownload的用法示例。


在下文中一共展示了ProductDownload::isFeatureActive方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: containsVirtualProducts

 public function containsVirtualProducts()
 {
     /*
      * EU-Legal
      * is at least one virtual product in cart?
      */
     if (!ProductDownload::isFeatureActive()) {
         return false;
     }
     if (!isset(self::$_isPartlyVirtualCart[$this->id])) {
         $products = $this->getProducts();
         if (!count($products)) {
             return false;
         }
         $is_partly_virtual = 0;
         foreach ($products as $product) {
             if ($product['is_virtual']) {
                 $is_partly_virtual = 1;
             }
         }
         self::$_isPartlyVirtualCart[$this->id] = (int) $is_partly_virtual;
     }
     return self::$_isPartlyVirtualCart[$this->id];
 }
开发者ID:juanchog,项目名称:modules-1.6.0.12,代码行数:24,代码来源:Cart.php

示例2: getIdFromIdProduct

    /**
     * Return the id_product_download from an id_product
     *
     * @param int $id_product Product the id
     * @return int Product the id for this virtual product
     */
    public static function getIdFromIdProduct($id_product)
    {
        if (!ProductDownload::isFeatureActive()) {
            return false;
        }
        if (array_key_exists((int) $id_product, self::$_productIds)) {
            return self::$_productIds[$id_product];
        }
        self::$_productIds[$id_product] = (int) Db::getInstance()->getValue('
		SELECT `id_product_download`
		FROM `' . _DB_PREFIX_ . 'product_download`
		WHERE `id_product` = ' . (int) $id_product . '
		AND `active` = 1
		ORDER BY `id_product_download` DESC');
        return self::$_productIds[$id_product];
    }
开发者ID:jpodracky,项目名称:dogs,代码行数:22,代码来源:ProductDownload.php

示例3: isVirtualCart

 /**
  * Check if cart contains only virtual products
  *
  * @return boolean true if is a virtual cart or false
  */
 public function isVirtualCart($strict = false)
 {
     if (!ProductDownload::isFeatureActive()) {
         return false;
     }
     if (!isset(self::$_isVirtualCart[$this->id])) {
         $products = $this->getProducts();
         if (!count($products)) {
             return false;
         }
         $is_virtual = 1;
         foreach ($products as $product) {
             if (empty($product['is_virtual'])) {
                 $is_virtual = 0;
             }
         }
         self::$_isVirtualCart[$this->id] = (int) $is_virtual;
     }
     return self::$_isVirtualCart[$this->id];
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:25,代码来源:Cart.php

示例4: getIdFromIdProduct

    /**
     * Return the id_product_download from an id_product
     *
     * @param int $id_product Product the id
     * @return int Product the id for this virtual product
     */
    public static function getIdFromIdProduct($id_product, $active = true)
    {
        if (!ProductDownload::isFeatureActive()) {
            return false;
        }
        self::$_productIds[$id_product] = (int) Db::getInstance()->getValue('
		SELECT `id_product_download`
		FROM `' . _DB_PREFIX_ . 'product_download`
		WHERE `id_product` = ' . (int) $id_product . '
		' . ($active ? ' AND `active` = 1' : '') . '
		ORDER BY `id_product_download` DESC');
        return self::$_productIds[$id_product];
    }
开发者ID:M03G,项目名称:PrestaShop,代码行数:19,代码来源:ProductDownload.php


注:本文中的ProductDownload::isFeatureActive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。