I have created a small module to add a product automatically at cart when a specific coupon code is applied. All is working fine except the product image is missing for the first time, but it shows the image after a refreshing full page.

product image missing in the checkout page

In my findings, KnockoutJS is working on this section to generate image/dom related stuff. Dom is not being ready properly as the product is added automatically.

I am not really sure what to do. Any help would be appreciated. Thank you.

Update: I added a new repo on GitHub for code review as it contains more codes. Please follow the link.

  • add your script that you tried, it will easy to help. – Sohel Rana Dec 16 '18 at 15:43
  • @SohelRana updated code link in the above. thank you. – Milan Chandro Dec 27 '18 at 16:47
  • I am having this problem as well. Does anyone know the answer? – Jeremy May 25 at 11:25
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review – HelgeB May 25 at 14:00

Just a loose thought : could it be a cache related problem ?

As i can see on default luma theme the url of the image looks like :


so could it be that this image is not cached yet ?

At the other hand you can always refresh the block by ajax.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.