Question

I want to change almost all the quote item attributes after adding it to care like name,price,sku and almost everything. As we have a requirement where at the runtime only we will decide this attributes. But I want to do that at Item level only and not at the product level. I have tried using the observer but there I was able to change the item price only using $item->setCustomPrice(); But when I do $item->setName("Custom Item Name"); this does not work and item name does not gets saved. Can some one please tell me what is the thing I am doing wrong or is there any other way by which I can achieve that.

Was it helpful?

Solution

you can use sales_quote_item_set_product and in observer file you can write below code to change the value.

$item = $observer->getEvent()->getQuoteItem();
$item->setName("Your new value");
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top