本文整理汇总了PHP中Thelia\Model\ConfigQuery::useTaxFreeAmounts方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigQuery::useTaxFreeAmounts方法的具体用法?PHP ConfigQuery::useTaxFreeAmounts怎么用?PHP ConfigQuery::useTaxFreeAmounts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thelia\Model\ConfigQuery
的用法示例。
在下文中一共展示了ConfigQuery::useTaxFreeAmounts方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildModelCriteria
//.........这里部分代码省略.........
$isPSELeftJoinList[] = 'is_promo';
$search->joinProductSaleElements('is_promo', Criteria::LEFT_JOIN)->where('`is_promo`.PROMO' . Criteria::EQUAL . '1')->where('NOT ISNULL(`is_promo`.ID)');
} elseif ($promo === false) {
$isPSELeftJoinList[] = 'is_promo';
$search->joinProductSaleElements('is_promo', Criteria::LEFT_JOIN)->where('`is_promo`.PROMO' . Criteria::EQUAL . '0')->where('NOT ISNULL(`is_promo`.ID)');
}
if (null != $min_stock) {
$isPSELeftJoinList[] = 'is_min_stock';
$search->joinProductSaleElements('is_min_stock', Criteria::LEFT_JOIN)->where('`is_min_stock`.QUANTITY' . Criteria::GREATER_THAN . '?', $min_stock, \PDO::PARAM_INT)->where('NOT ISNULL(`is_min_stock`.ID)');
}
if (null != $min_weight) {
$isPSELeftJoinList[] = 'is_min_weight';
$search->joinProductSaleElements('is_min_weight', Criteria::LEFT_JOIN)->where('`is_min_weight`.WEIGHT' . Criteria::GREATER_THAN . '?', $min_weight, \PDO::PARAM_STR)->where('NOT ISNULL(`is_min_weight`.ID)');
}
if (null != $max_weight) {
$isPSELeftJoinList[] = 'is_max_weight';
$search->joinProductSaleElements('is_max_weight', Criteria::LEFT_JOIN)->where('`is_max_weight`.WEIGHT' . Criteria::LESS_THAN . '?', $max_weight, \PDO::PARAM_STR)->where('NOT ISNULL(`is_max_weight`.ID)');
}
$attributeNonStrictMatch = $this->getAttribute_non_strict_match();
if ($attributeNonStrictMatch != '*') {
if ($attributeNonStrictMatch == 'none') {
$actuallyUsedAttributeNonStrictMatchList = $isPSELeftJoinList;
} else {
$actuallyUsedAttributeNonStrictMatchList = array_values(array_intersect($isPSELeftJoinList, $attributeNonStrictMatch));
}
foreach ($actuallyUsedAttributeNonStrictMatchList as $key => $actuallyUsedAttributeNonStrictMatch) {
if ($key == 0) {
continue;
}
$search->where('`' . $actuallyUsedAttributeNonStrictMatch . '`.ID=' . '`' . $actuallyUsedAttributeNonStrictMatchList[$key - 1] . '`.ID');
}
}
if (null !== $min_price) {
if (false === ConfigQuery::useTaxFreeAmounts()) {
// @todo
}
$isPSELeftJoinList[] = 'is_min_price';
$isProductPriceFirstLeftJoin = ['is_min_price', 'min_price_data'];
$minPriceJoin = new Join();
$minPriceJoin->addExplicitCondition(ProductSaleElementsTableMap::TABLE_NAME, 'ID', 'is_min_price', ProductPriceTableMap::TABLE_NAME, 'PRODUCT_SALE_ELEMENTS_ID', 'min_price_data');
$minPriceJoin->setJoinType(Criteria::LEFT_JOIN);
$search->joinProductSaleElements('is_min_price', Criteria::LEFT_JOIN)->addJoinObject($minPriceJoin, 'is_min_price_join')->addJoinCondition('is_min_price_join', '`min_price_data`.`currency_id` = ?', $currency->getId(), null, \PDO::PARAM_INT);
if ($defaultCurrency->getId() != $currency->getId()) {
$minPriceJoinDefaultCurrency = new Join();
$minPriceJoinDefaultCurrency->addExplicitCondition(ProductSaleElementsTableMap::TABLE_NAME, 'ID', 'is_min_price', ProductPriceTableMap::TABLE_NAME, 'PRODUCT_SALE_ELEMENTS_ID', 'min_price_data' . $defaultCurrencySuffix);
$minPriceJoinDefaultCurrency->setJoinType(Criteria::LEFT_JOIN);
$search->addJoinObject($minPriceJoinDefaultCurrency, 'is_min_price_join' . $defaultCurrencySuffix)->addJoinCondition('is_min_price_join' . $defaultCurrencySuffix, '`min_price_data' . $defaultCurrencySuffix . '`.`currency_id` = ?', $defaultCurrency->getId(), null, \PDO::PARAM_INT);
/**
* In propel we trust : $currency->getRate() always returns a float.
* Or maybe not : rate value is checked as a float in overloaded getRate method.
*/
$MinPriceToCompareAsSQL = 'CASE WHEN ISNULL(CASE WHEN `is_min_price`.PROMO=1 THEN `min_price_data`.PROMO_PRICE ELSE `min_price_data`.PRICE END) OR `min_price_data`.FROM_DEFAULT_CURRENCY = 1 THEN
CASE WHEN `is_min_price`.PROMO=1 THEN `min_price_data' . $defaultCurrencySuffix . '`.PROMO_PRICE ELSE `min_price_data' . $defaultCurrencySuffix . '`.PRICE END * ' . $currency->getRate() . '
ELSE
CASE WHEN `is_min_price`.PROMO=1 THEN `min_price_data`.PROMO_PRICE ELSE `min_price_data`.PRICE END
END';
} else {
$MinPriceToCompareAsSQL = 'CASE WHEN `is_min_price`.PROMO=1 THEN `min_price_data`.PROMO_PRICE ELSE `min_price_data`.PRICE END';
}
$search->where('ROUND(' . $MinPriceToCompareAsSQL . ', 2)>=?', $min_price, \PDO::PARAM_STR);
}
if (null !== $max_price) {
$isPSELeftJoinList[] = 'is_max_price';
$isProductPriceFirstLeftJoin = ['is_max_price', 'max_price_data'];
$maxPriceJoin = new Join();
$maxPriceJoin->addExplicitCondition(ProductSaleElementsTableMap::TABLE_NAME, 'ID', 'is_max_price', ProductPriceTableMap::TABLE_NAME, 'PRODUCT_SALE_ELEMENTS_ID', 'max_price_data');