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


PHP SpecificPrice::isFeatureActive方法代碼示例

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


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

示例1: getQuantityDiscounts

    public static function getQuantityDiscounts($id_product, $id_shop, $id_currency, $id_country, $id_group, $id_product_attribute = null, $all_combinations = false, $id_customer = 0)
    {
        if (!SpecificPrice::isFeatureActive()) {
            return array();
        }
        $now = date('Y-m-d H:i:s');
        $res = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
			SELECT *,
					' . SpecificPrice::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group, $id_customer) . '
			FROM `' . _DB_PREFIX_ . 'specific_price`
			WHERE
					`id_product` IN(0, ' . (int) $id_product . ') AND
					' . (!$all_combinations ? '`id_product_attribute` IN(0, ' . (int) $id_product_attribute . ') AND ' : '') . '
					`id_shop` IN(0, ' . (int) $id_shop . ') AND
					`id_currency` IN(0, ' . (int) $id_currency . ') AND
					`id_country` IN(0, ' . (int) $id_country . ') AND
					`id_group` IN(0, ' . (int) $id_group . ') AND
					`id_customer` IN(0, ' . (int) $id_customer . ')
					AND
					(
						(`from` = \'0000-00-00 00:00:00\' OR \'' . $now . '\' >= `from`)
						AND
						(`to` = \'0000-00-00 00:00:00\' OR \'' . $now . '\' <= `to`)
					)
					ORDER BY `from_quantity` ASC, `id_specific_price_rule` ASC, `score` DESC
		');
        $targeted_prices = array();
        $last_quantity = array();
        foreach ($res as $specific_price) {
            if (!isset($last_quantity[(int) $specific_price['id_product_attribute']])) {
                $last_quantity[(int) $specific_price['id_product_attribute']] = $specific_price['from_quantity'];
            } elseif ($last_quantity[(int) $specific_price['id_product_attribute']] == $specific_price['from_quantity']) {
                continue;
            }
            $last_quantity[(int) $specific_price['id_product_attribute']] = $specific_price['from_quantity'];
            if ($specific_price['from_quantity'] > PP::getSpecificPriceFromQty((int) $id_product)) {
                $targeted_prices[] = $specific_price;
            }
        }
        return $targeted_prices;
    }
開發者ID:Oldwo1f,項目名稱:yakaboutique,代碼行數:41,代碼來源:SpecificPrice.php

示例2: getProductIdByDate

    public static function getProductIdByDate($id_shop, $id_currency, $id_country, $id_group, $beginning, $ending, $id_customer = 0, $with_combination_id = false)
    {
        if (!SpecificPrice::isFeatureActive()) {
            return array();
        }
        $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
			SELECT `id_product`, `id_product_attribute`
			FROM `' . _DB_PREFIX_ . 'specific_price`
			WHERE	`id_shop` IN(0, ' . (int) $id_shop . ') AND
					`id_currency` IN(0, ' . (int) $id_currency . ') AND
					`id_country` IN(0, ' . (int) $id_country . ') AND
					`id_group` IN(0, ' . (int) $id_group . ') AND
					`id_customer` IN(0, ' . (int) $id_customer . ') AND
					`from_quantity` = 1 AND
					(
						(`from` = \'0000-00-00 00:00:00\' OR \'' . pSQL($beginning) . '\' >= `from`)
						AND
						(`to` = \'0000-00-00 00:00:00\' OR \'' . pSQL($ending) . '\' <= `to`)
					)
					AND
					`reduction` > 0
		', false);
        $ids_product = array();
        while ($row = Db::getInstance()->nextRow($result)) {
            $ids_product[] = $with_combination_id ? array('id_product' => (int) $row['id_product'], 'id_product_attribute' => (int) $row['id_product_attribute']) : (int) $row['id_product'];
        }
        return $ids_product;
    }
開發者ID:rongandat,項目名稱:vatfairfoot,代碼行數:28,代碼來源:SpecificPrice.php

示例3: _getProductIdByDate

    protected function _getProductIdByDate($beginning, $ending, Context $context = null, $with_combination_id = false, $id_customer = 0, $deal = false)
    {
        if (!$context) {
            $context = Context::getContext();
        }
        $id_address = $context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')};
        $ids = Address::getCountryAndState($id_address);
        $id_country = $ids['id_country'] ? (int) $ids['id_country'] : (int) Configuration::get('PS_COUNTRY_DEFAULT');
        if (!SpecificPrice::isFeatureActive()) {
            return array();
        }
        if ($deal == true) {
            $where = '(`from` = \'0000-00-00 00:00:00\' OR \'' . pSQL($beginning) . '\' >= `from`) AND (`to` != \'0000-00-00 00:00:00\' AND \'' . pSQL($ending) . '\' <= `to`)';
        } else {
            $where = '(`from` = \'0000-00-00 00:00:00\' OR \'' . pSQL($beginning) . '\' >= `from`) AND (`to` = \'0000-00-00 00:00:00\' OR \'' . pSQL($ending) . '\' <= `to`)';
        }
        $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
			SELECT `id_product`, `id_product_attribute`
			FROM `' . _DB_PREFIX_ . 'specific_price`
			WHERE	`id_shop` IN(0, ' . (int) $context->shop->id . ') AND
					`id_currency` IN(0, ' . (int) $context->currency->id . ') AND
					`id_country` IN(0, ' . (int) $id_country . ') AND
					`id_group` IN(0, ' . (int) $context->customer->id_default_group . ') AND
					`id_customer` IN(0, ' . (int) $id_customer . ') AND
					`from_quantity` = 1 AND
					(' . $where . ') 
					AND
					`reduction` > 0
		', false);
        $ids_product = array();
        while ($row = Db::getInstance()->nextRow($result)) {
            $ids_product[] = $with_combination_id ? array('id_product' => (int) $row['id_product'], 'id_product_attribute' => (int) $row['id_product_attribute']) : (int) $row['id_product'];
        }
        return $ids_product;
    }
開發者ID:zangles,項目名稱:lennyba,代碼行數:35,代碼來源:megaboxs.php

示例4: getProductIdByDate

    public static function getProductIdByDate($id_shop, $id_currency, $id_country, $id_group, $beginning, $ending, $id_customer = 0, $with_combination_id = false)
    {
        if (!SpecificPrice::isFeatureActive()) {
            return array();
        }
        $query_extra = self::computeExtraConditions(null, null, $id_customer, null, $beginning, $ending);
        $results = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
			SELECT `id_product`, `id_product_attribute`
			FROM `' . _DB_PREFIX_ . 'specific_price`
			WHERE	`id_shop` ' . self::formatIntInQuery(0, $id_shop) . ' AND
					`id_currency` ' . self::formatIntInQuery(0, $id_currency) . ' AND
					`id_country` ' . self::formatIntInQuery(0, $id_country) . ' AND
					`id_group` ' . self::formatIntInQuery(0, $id_group) . ' AND
					`from_quantity` = 1 AND
					`reduction` > 0
		' . $query_extra);
        $ids_product = array();
        foreach ($results as $key => $value) {
            $ids_product[] = $with_combination_id ? array('id_product' => (int) $value['id_product'], 'id_product_attribute' => (int) $value['id_product_attribute']) : (int) $value['id_product'];
        }
        return $ids_product;
    }
開發者ID:prestanesia,項目名稱:PrestaShop,代碼行數:22,代碼來源:SpecificPrice.php

示例5: getSpecificPriceById

    public static function getSpecificPriceById($id_specific_price)
    {
        if (!SpecificPrice::isFeatureActive()) {
            return array();
        }
        $res = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
			SELECT *
			FROM `' . _DB_PREFIX_ . 'specific_price` sp
			WHERE `id_specific_price` =' . (int) $id_specific_price);
        return $res;
    }
開發者ID:pacxs,項目名稱:pacxscom,代碼行數:11,代碼來源:leocustomajax.php


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