Timeline for Dynamically calculated prices save after add to cart
Current License: CC BY-SA 3.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 3, 2016 at 12:49 | comment | added | Rat | Hi, I tried the above code its work fine. But I first add to cart the product after login, order item custom fields set to null. Where to update the custom field values after login? | |
Apr 11, 2016 at 4:16 | comment | added | Rat | Hi, i tried to above, but not work for custom price. | |
Apr 6, 2016 at 8:58 | comment | added | Anil Suthar |
Instead of placing your event observer code into the <frontend> , put it into <global> node in your module's config.xml file. This will work for front and admin also. BTW, you can accept this answer :)
|
|
Apr 6, 2016 at 8:46 | comment | added | Rat | Hi , Just Remove the $item->save(). Its working fine. How to implement same as in admin order creation page? | |
Apr 6, 2016 at 8:09 | comment | added | Anil Suthar |
What's $item->save(); here ? I never mentioned that. Can you use EXACT code/method that I have posted, for testing, to check if it's working for you ?
|
|
Apr 6, 2016 at 6:55 | comment | added | Rat |
Hi, I added the $item->setCustomPrice($custom_price); $item->setOriginalCustomPrice($custom_price); $item->getProduct()->setIsSuperMode(true); $item->save(); But same error message show. This issue occured not logged customers only.
|
|
Apr 6, 2016 at 5:55 | comment | added | Anil Suthar |
I think you are missing $item->getProduct()->setIsSuperMode(true); line. You need to use $item->getProduct()->setIsSuperMode(true); in order to make $item->setCustomPrice(); and $item->setOriginalCustomPrice($price); to work.
|
|
Apr 5, 2016 at 12:32 | comment | added | Rat | If not logged in customer, i got the message as "Cannot add the item to shopping cart". Once login , its work perfectly. | |
Apr 5, 2016 at 11:47 | comment | added | Rat |
This is my function - public function updatePrice( Varien_Event_Observer $observer ) { $item = $observer->getQuoteItem(); $item = ( $item->getParentItem() ? $item->getParentItem() : $item ); $org_price = $item->getProduct()->getFinalPrice(); $custom_price = $org_price * $_REQUEST['cellcount']; // echo $quote_item->getPrice(); //$new_price = 2000*$_REQUEST['cellcount']; $item->setCustomPrice($custom_price); $item->setOriginalCustomPrice($custom_price); $item->save(); }
|
|
Apr 5, 2016 at 11:47 | comment | added | Rat | Hi, i cant add the product to cart. Show the error message as "Canot add to product in cart". | |
Mar 31, 2016 at 7:08 | review | First posts | |||
Mar 31, 2016 at 7:59 | |||||
Mar 31, 2016 at 7:04 | history | answered | Anil Suthar | CC BY-SA 3.0 |