Exam4Training

How can this be resolved?

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?
A . Create an implementation for MagentoCatalogHodelProductPriceModifierlnterf ace.
B. Create an after plugin On MagentoCatalogApiDataBasePriceInterface:: getPrice.
C. Create a plugin forMagentoCatalogModelIndexerProductPrice::executeRow.

Answer: C

Explanation:

The developer can resolve this issue by creating a plugin for the MagentoCatalogModelIndexerProductPrice::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(

MagentoCatalogModelIndexerProductPrice $subject,

MagentoCatalogModelProduct $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.

Latest AD0-E716 Dumps Valid Version with 69 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Exit mobile version