Last active
May 19, 2022 11:01
-
-
Save 6ui11em/a991dd5c1db48a5e6a5867c6309f54f6 to your computer and use it in GitHub Desktop.
Magento 2: Aplicar conditions al collection #mageno2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Magento\Rule\Model\Condition\Sql\Builder as SqlBuilder; | |
... | |
/** @var $collection Collection */ | |
$collection = $this->productCollectionFactory->create(); | |
$conditions = $this->getConditions(); | |
$productConditions = $this->getProductConditions(); | |
$conditions->collectValidatedAttributes($collection); | |
$this->sqlBuilder->attachConditionToCollection($collection, $productConditions, $conditions); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment