Skip to main content
deleted 249 characters in body
Source Link
Devidas
  • 3.4k
  • 1
  • 28
  • 63

I have an observer who changes the price of the items and at the end of the routine the whole order changes, but on my cart edit screen the subtotal of the item still keeps the old price of the item, how can I fix this?

The functions used to make the change are:

$itemcarrinho->setCustomPrice($temp);
                                          
$itemcarrinho->setOriginalCustomPrice($temp);
                                         
$itemcarrinho->getProduct()->setIsSuperMode(true);
                                        $itemcarrinho->save();
                                         
$quote->setSubtotal($total)
                                            ->setBaseSubtotal($total)
                                            ->setGrandTotal($total)
                                            ->setBaseGrandTotal($total);
                                        $quote->save();

enter image description here

Magento 2.3.5

I have an observer who changes the price of the items and at the end of the routine the whole order changes, but on my cart edit screen the subtotal of the item still keeps the old price of the item, how can I fix this?

The functions used to make the change are:

$itemcarrinho->setCustomPrice($temp);
                                         $itemcarrinho->setOriginalCustomPrice($temp);
                                        $itemcarrinho->getProduct()->setIsSuperMode(true);
                                        $itemcarrinho->save();
                                        $quote->setSubtotal($total)
                                            ->setBaseSubtotal($total)
                                            ->setGrandTotal($total)
                                            ->setBaseGrandTotal($total);
                                        $quote->save();

enter image description here

Magento 2.3.5

I have an observer who changes the price of the items and at the end of the routine the whole order changes, but on my cart edit screen the subtotal of the item still keeps the old price of the item, how can I fix this?

The functions used to make the change are:

$itemcarrinho->setCustomPrice($temp);                                         
$itemcarrinho->setOriginalCustomPrice($temp);                                      
$itemcarrinho->getProduct()->setIsSuperMode(true);
$itemcarrinho->save();
 
$quote->setSubtotal($total)
->setBaseSubtotal($total)
->setGrandTotal($total)
->setBaseGrandTotal($total);
$quote->save();

enter image description here

Magento 2.3.5

Source Link

Divergence in prices

I have an observer who changes the price of the items and at the end of the routine the whole order changes, but on my cart edit screen the subtotal of the item still keeps the old price of the item, how can I fix this?

The functions used to make the change are:

$itemcarrinho->setCustomPrice($temp);
                                        $itemcarrinho->setOriginalCustomPrice($temp);
                                        $itemcarrinho->getProduct()->setIsSuperMode(true);
                                        $itemcarrinho->save();
                                        $quote->setSubtotal($total)
                                            ->setBaseSubtotal($total)
                                            ->setGrandTotal($total)
                                            ->setBaseGrandTotal($total);
                                        $quote->save();

enter image description here

Magento 2.3.5