Valid AD0-E716 Dumps shared by ExamDiscuss.com for Helping Passing AD0-E716 Exam! ExamDiscuss.com now offer the newest AD0-E716 exam dumps, the ExamDiscuss.com AD0-E716 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com AD0-E716 dumps with Test Engine here:
An Adobe Commerce developer has been tasked with applying a pricing adjustment to products on the website. The adjustments come from a database table. In this case, catalog price rules do not work. They created a plugin for getPrice on the price model, but the layered navigation is still displaying the old price. How can this be resolved?
Correct Answer: C
The developer can resolve this issue by creating a plugin for the Magento\Catalog\Model\Indexer\Product\Price::executeRow() method. This method is responsible for updating the product price index. The plugin can be used to add the pricing adjustment from the database to the product price index. Once the product price index is updated, the layered navigation will display the correct price. Here is an example of a plugin for the executeRow() method: PHP class MyPlugin { public function executeRow( \Magento\Catalog\Model\Indexer\Product\Price $subject, \Magento\Catalog\Model\Product $product, array $data ) { $adjustment = $this->getAdjustment($product); $product->setPrice($product->getPrice() + $adjustment); } private function getAdjustment(Product $product) { $adjustment = $product->getData('adjustment'); if (!is_numeric($adjustment)) { return 0; } return $adjustment; } } This plugin will add the adjustment data from the product to the product price index. Once the product price index is updated, the layered navigation will display the correct price.