Here in my custom module:
This product with 50 quantities price is 6,000
But when I add to cart this multiplies
So how I can fix this?
Can I use observer to change this or are there any other best way?
Thanks
if ($quoteId != 0 && ($priceOne!=$item->getCustomPrice() || $quoteQty!=$item->getQty())) {
$flag = 1;
$item->setCustomPrice($priceOne);
$item->setOriginalCustomPrice($priceOne);
$item->setQty($quoteQty);
//$item->setRowTotal($priceOne * $quoteQty);
$item->setRowTotal($priceOne * 1);
$item->getProduct()->setIsSuperMode(true);
if ($helper->checkAndUpdateForDiscount($item)) {
$item->setNoDiscount(1);
} else {
$item->setNoDiscount(0);
}
$item->save();
$this->_messageManager->addNotice(
__(
"You can't edit quote items"
)
);
}
}
}