0

I'm doing some work on catalog rules.

I stumbled upon this class right here Magento\CatalogRule\Pricing\Price\CatalogRulePrice which is a price model that calculates the catalog rule price of a product.

It is added in the Price Pool here vendor/magento/module-catalog-rule/etc/di.xml

<virtualType name="Magento\Catalog\Pricing\Price\Pool" type="Magento\Framework\Pricing\Price\Pool">
        <arguments>
            <argument name="prices" xsi:type="array">
                <item name="catalog_rule_price" xsi:type="string">Magento\CatalogRule\Pricing\Price\CatalogRulePrice</item>
            </argument>
        </arguments>
    </virtualType>

Now the only usage of it's getValue() method that I could find is in tests.

I know that when displaying Prices in frontend this observer is used \Magento\CatalogRule\Observer\ProcessFrontFinalPriceObserver (which does not use the above mentioned price model)

So what is the point of this price model? Where is it used?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.