Setting images for customLineItems using currentCart.addToCurrentCart()

Question:
How do I add a custom HTTPS image URL to a customeLineItem object when using the currentCart.addToCurrentCart() wix-backend API.

Product:
Velo, using Wix Studio Editor

What amI trying to achieve:
I’m building a complex product configurator and using the currentCart.addToCurrentCart() as per this docs example. I’m using the customeLineItems option and things mostly work but one thing that isn’t working is setting the media field. Docs say it’s a string that accepts both wix:image://... and https://... URLs - but no matter what https:// URL I set it to, the added line item always has looks like this -

{
  // ...
  "image": ""
  // ...
}

What have I already tried:
Looked a lot online, couldn’t find a lot of documentation on this area. Tried using different HTTPS urls, including even one from the Wix Media Manager, but all give the same result. If I don’t provide the media field, the added item also doesn’t have the image field - so it’s pretty clear it should be doing something.

in the docs you linked, I’m seeing that it should be media: "link to media source" instead of image. Let us know if this works

Also note that the left side of that object option should not be in quotes

Hey Amanda, thanks for the input!

My original message might have been a bit confusing, but I actually was using the media property. The image property is not on the request I send, but rather on the line items that ends up getting added to the cart.

I’ve actually looked a bit further into this and it seems that the wix:image://... URLs work fine and result in a non-empty image property, but any https://... URLs don’e work (even wixstatic URLs to images from the Wix Media Manager).

I’ve opened a bug report and though the Wix folks have’t officially approved it’s a bug, they are currently “looking into it” :upside_down_face:

1 Like

Thanks for following up and the additional details - I’m glad you have a path forward with the wix image url and I assure you that customer care will get back to you via the ticket when they have more information.