I created a controller to add configurable product to cart but when i try to reload the minicart dynamically using javascript or even refresh the page in product detail page it shows the wrong price and wrong color for the product, but when i go to /checkout/cart, the mini-cart shows the right product price and color. to load the minicart dynamically using javascript, i use the minicart block from controller like this:

 if ($this->getLayout()->getBlock('minicart'))
  $minicart = $this->getLayout()->getBlock('minicart')->toHtml();

here's the wrong minicart example after i add the product to the cart in product page details:

wrong mini-cart

and after i go to /checkout/cart, the mini cart shows the right price and product color:

right mini-cart

  • You'd post code of minicart block... it seems you're loading configurable product in first screenshot, and the simple product in the second – Raul Sanchez May 10 '17 at 8:56
  • Have u found any solution for this issue? – Prema Karthik Feb 18 '19 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.