Permalink
Browse files

Added tax rule ID parameters to product loop

  • Loading branch information...
roadster31 committed Jan 5, 2019
1 parent 5a71c90 commit fd18c003e2c1d42affa745775aaa681a5c772c7c
Showing with 12 additions and 0 deletions.
  1. +12 −0 core/lib/Thelia/Core/Template/Loop/Product.php
@@ -78,6 +78,8 @@
* @method string[] getFeatureValues()
* @method string[] getAttributeNonStrictMatch()
* @method int[] getTemplateId()
* @method int[] getTaxRuleId()
* @method int[] getExcludeTaxRuleId()
*/
class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchLoopInterface
{
@@ -117,6 +119,8 @@ protected function getArgDefinitions()
Argument::createIntTypeArgument('currency'),
Argument::createAnyTypeArgument('title'),
Argument::createIntListTypeArgument('template_id'),
Argument::createIntListTypeArgument('tax_rule_id'),
Argument::createIntListTypeArgument('exclude_tax_rule_id'),
new Argument(
'order',
new TypeCollection(
@@ -734,6 +738,14 @@ public function buildModelCriteria()
;
}
if (null !== $taxRuleIdList = $this->getTaxRuleId()) {
$search->filterByTaxRuleId($taxRuleIdList, Criteria::IN);
}
if (null !== $taxRuleIdList = $this->getExcludeTaxRuleId()) {
$search->filterByTaxRuleId($taxRuleIdList, Criteria::NOT_IN);
}
$new = $this->getNew();
$promo = $this->getPromo();
$min_stock = $this->getMinStock();

0 comments on commit fd18c00

Please sign in to comment.