How to update subtotal after changing price with observer The 2019 Stack Overflow Developer Survey Results Are InUpdate product custom option price in observerDynamically add extra price on subtotal on cartHow to change product name in quote item dynamicallySubtotal doubled in cart after updateSet custom price of product when adding to cart code not workinghow to update cart subtotal after change item price with observer magento 1.8update price Observer is not working on cart pageHow to change price (Custom Price) of Bundle Child products during add to cart using observerMagento 2 : How to Update Price After Changing Qty On Cartmini cart subtotal update in observer
How to answer pointed "are you quitting" questioning when I don't want them to suspect
What does "fetching by region is not available for SAM files" means?
Should I use my personal e-mail address, or my workplace one, when registering to external websites for work purposes?
Does a dangling wire really electrocute me if I'm standing in water?
Worn-tile Scrabble
What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?
Are children permitted to help build the Beis Hamikdash?
What do hard-Brexiteers want with respect to the Irish border?
Can a rogue use sneak attack with weapons that have the thrown property even if they are not thrown?
Is there a symbol for a right arrow with a square in the middle?
Falsification in Math vs Science
Geography at the pixel level
Can you compress metal and what would be the consequences?
Is there any way to tell whether the shot is going to hit you or not?
Have you ever entered Singapore using a different passport or name?
How to support a colleague who finds meetings extremely tiring?
For what reasons would an animal species NOT cross a *horizontal* land bridge?
FPGA - DIY Programming
How to save as into a customized destination on macOS?
How to notate time signature switching consistently every measure
Resizing object distorts it (Illustrator CC 2018)
Landlord wants to switch my lease to a "Land contract" to "get back at the city"
Do these rules for Critical Successes and Critical Failures seem Fair?
If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?
How to update subtotal after changing price with observer
The 2019 Stack Overflow Developer Survey Results Are InUpdate product custom option price in observerDynamically add extra price on subtotal on cartHow to change product name in quote item dynamicallySubtotal doubled in cart after updateSet custom price of product when adding to cart code not workinghow to update cart subtotal after change item price with observer magento 1.8update price Observer is not working on cart pageHow to change price (Custom Price) of Bundle Child products during add to cart using observerMagento 2 : How to Update Price After Changing Qty On Cartmini cart subtotal update in observer
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am using observer to change bundle product price. I have tried events 'checkout_cart_product_add_after' and 'checkout_cart_save_after'. Both events update product's price but subtotal remains same. In my case Price is 50 and Subtotal is 18.
Observer code (checkout_cart_save_after):
public function apply_customprice(Varien_Event_Observer $observer)
$quote= $observer->getCart()->getQuote();
foreach ($quote->getAllItems() as $bundleitems)
$parentProductId = $bundleitems->getProduct()->getId();
if($bundleitems->getProduct()->getTypeId() == 'bundle')
$storeId = Mage::app()->getStore()->getStoreId();
$Custom_price= 50;
$item = Mage::getModel('sales/quote_item')->load($bundleitems->getId());
$product_id = $item->getProductId();
$product = Mage::getModel('catalog/product')->load($product_id);
$item->setStoreId($storeId);
$item->setCustomPrice($Custom_price);
$item->setOriginalCustomPrice($Custom_price);
$item->setProduct($product);
$item->save();
//for updating the totals
$quote = Mage::getModel('checkout/session')->getQuote();
$quote->collectTotals()->save();
magento-1.9 cart event-observer bundled-product
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I am using observer to change bundle product price. I have tried events 'checkout_cart_product_add_after' and 'checkout_cart_save_after'. Both events update product's price but subtotal remains same. In my case Price is 50 and Subtotal is 18.
Observer code (checkout_cart_save_after):
public function apply_customprice(Varien_Event_Observer $observer)
$quote= $observer->getCart()->getQuote();
foreach ($quote->getAllItems() as $bundleitems)
$parentProductId = $bundleitems->getProduct()->getId();
if($bundleitems->getProduct()->getTypeId() == 'bundle')
$storeId = Mage::app()->getStore()->getStoreId();
$Custom_price= 50;
$item = Mage::getModel('sales/quote_item')->load($bundleitems->getId());
$product_id = $item->getProductId();
$product = Mage::getModel('catalog/product')->load($product_id);
$item->setStoreId($storeId);
$item->setCustomPrice($Custom_price);
$item->setOriginalCustomPrice($Custom_price);
$item->setProduct($product);
$item->save();
//for updating the totals
$quote = Mage::getModel('checkout/session')->getQuote();
$quote->collectTotals()->save();
magento-1.9 cart event-observer bundled-product
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I am using observer to change bundle product price. I have tried events 'checkout_cart_product_add_after' and 'checkout_cart_save_after'. Both events update product's price but subtotal remains same. In my case Price is 50 and Subtotal is 18.
Observer code (checkout_cart_save_after):
public function apply_customprice(Varien_Event_Observer $observer)
$quote= $observer->getCart()->getQuote();
foreach ($quote->getAllItems() as $bundleitems)
$parentProductId = $bundleitems->getProduct()->getId();
if($bundleitems->getProduct()->getTypeId() == 'bundle')
$storeId = Mage::app()->getStore()->getStoreId();
$Custom_price= 50;
$item = Mage::getModel('sales/quote_item')->load($bundleitems->getId());
$product_id = $item->getProductId();
$product = Mage::getModel('catalog/product')->load($product_id);
$item->setStoreId($storeId);
$item->setCustomPrice($Custom_price);
$item->setOriginalCustomPrice($Custom_price);
$item->setProduct($product);
$item->save();
//for updating the totals
$quote = Mage::getModel('checkout/session')->getQuote();
$quote->collectTotals()->save();
magento-1.9 cart event-observer bundled-product
I am using observer to change bundle product price. I have tried events 'checkout_cart_product_add_after' and 'checkout_cart_save_after'. Both events update product's price but subtotal remains same. In my case Price is 50 and Subtotal is 18.
Observer code (checkout_cart_save_after):
public function apply_customprice(Varien_Event_Observer $observer)
$quote= $observer->getCart()->getQuote();
foreach ($quote->getAllItems() as $bundleitems)
$parentProductId = $bundleitems->getProduct()->getId();
if($bundleitems->getProduct()->getTypeId() == 'bundle')
$storeId = Mage::app()->getStore()->getStoreId();
$Custom_price= 50;
$item = Mage::getModel('sales/quote_item')->load($bundleitems->getId());
$product_id = $item->getProductId();
$product = Mage::getModel('catalog/product')->load($product_id);
$item->setStoreId($storeId);
$item->setCustomPrice($Custom_price);
$item->setOriginalCustomPrice($Custom_price);
$item->setProduct($product);
$item->save();
//for updating the totals
$quote = Mage::getModel('checkout/session')->getQuote();
$quote->collectTotals()->save();
magento-1.9 cart event-observer bundled-product
magento-1.9 cart event-observer bundled-product
asked Apr 20 '17 at 15:47
SayaliSayali
651416
651416
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I could be mistaken, but it seems like your question is very similar to another one that has been answered here. If so, try to add your observer to the sales_quote_save_before event and use this line to force recalculation: $quote->setTotalsCollectedFlag(false)->collectTotals(); rather than calling save() again.
Thank you for the answer. I solved this issue by setting bundle product price to fixed :)
– Sayali
Apr 28 '17 at 8:12
@Sayali - glad you found a resolution. You should post the details in an answer to your question and mark it as accepted to help others!
– fantasticrice
Apr 28 '17 at 14:18
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f171007%2fhow-to-update-subtotal-after-changing-price-with-observer%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I could be mistaken, but it seems like your question is very similar to another one that has been answered here. If so, try to add your observer to the sales_quote_save_before event and use this line to force recalculation: $quote->setTotalsCollectedFlag(false)->collectTotals(); rather than calling save() again.
Thank you for the answer. I solved this issue by setting bundle product price to fixed :)
– Sayali
Apr 28 '17 at 8:12
@Sayali - glad you found a resolution. You should post the details in an answer to your question and mark it as accepted to help others!
– fantasticrice
Apr 28 '17 at 14:18
add a comment |
I could be mistaken, but it seems like your question is very similar to another one that has been answered here. If so, try to add your observer to the sales_quote_save_before event and use this line to force recalculation: $quote->setTotalsCollectedFlag(false)->collectTotals(); rather than calling save() again.
Thank you for the answer. I solved this issue by setting bundle product price to fixed :)
– Sayali
Apr 28 '17 at 8:12
@Sayali - glad you found a resolution. You should post the details in an answer to your question and mark it as accepted to help others!
– fantasticrice
Apr 28 '17 at 14:18
add a comment |
I could be mistaken, but it seems like your question is very similar to another one that has been answered here. If so, try to add your observer to the sales_quote_save_before event and use this line to force recalculation: $quote->setTotalsCollectedFlag(false)->collectTotals(); rather than calling save() again.
I could be mistaken, but it seems like your question is very similar to another one that has been answered here. If so, try to add your observer to the sales_quote_save_before event and use this line to force recalculation: $quote->setTotalsCollectedFlag(false)->collectTotals(); rather than calling save() again.
edited May 23 '17 at 12:37
Community♦
1
1
answered Apr 20 '17 at 16:15
fantasticricefantasticrice
691616
691616
Thank you for the answer. I solved this issue by setting bundle product price to fixed :)
– Sayali
Apr 28 '17 at 8:12
@Sayali - glad you found a resolution. You should post the details in an answer to your question and mark it as accepted to help others!
– fantasticrice
Apr 28 '17 at 14:18
add a comment |
Thank you for the answer. I solved this issue by setting bundle product price to fixed :)
– Sayali
Apr 28 '17 at 8:12
@Sayali - glad you found a resolution. You should post the details in an answer to your question and mark it as accepted to help others!
– fantasticrice
Apr 28 '17 at 14:18
Thank you for the answer. I solved this issue by setting bundle product price to fixed :)
– Sayali
Apr 28 '17 at 8:12
Thank you for the answer. I solved this issue by setting bundle product price to fixed :)
– Sayali
Apr 28 '17 at 8:12
@Sayali - glad you found a resolution. You should post the details in an answer to your question and mark it as accepted to help others!
– fantasticrice
Apr 28 '17 at 14:18
@Sayali - glad you found a resolution. You should post the details in an answer to your question and mark it as accepted to help others!
– fantasticrice
Apr 28 '17 at 14:18
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f171007%2fhow-to-update-subtotal-after-changing-price-with-observer%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown