I’m trying to create a custom price type in Magento. And for that I’ve created a custom attribute to a product.
And I’ve added this price type to MagentoCatalogPricingPricePool
like below in my di.xml file
<virtualType name="MagentoCatalogPricingPricePool" type="MagentoFrameworkPricingPricePool">
<arguments>
<argument name="prices" xsi:type="array">
<item name="pre_order_price" xsi:type="string">MyVendorPreOrderPricingPricePreOrderPrice</item>
</argument>
</arguments>
</virtualType>
After that I can see the price in PLP and PDP perfectly.
But the problem is when I’m trying to add this product to cart. Magento is ignoring my pre_order_price and taking the special price or regular price.
I’ve already search for this issue and found some answer on the internet suggesting to use observer or plugin. But I doubt whether it is the correct way to overcome this scenario. I already looked into the Magento core. Unfortunately did not find the answer yet, why Magento is ignoring my custom price type while adding this product to cart.
It would be very nice if anyone can guide me in this area. Thanks in advance.