Solved

Problem with dynamic product repeats and images

  • 20 May 2024
  • 5 replies
  • 70 views

Badge

I’ve been building abandoned cart, checkout and browse email flows, following the instructions in:

I can get the table to repeat, and bring in the subsequent products. However, if there’s more than one item in the abandoned basket it shows the text of those products twice (i.e. if there were two products in the basket, it shows product 1, product 2, product 1, product 2). 

Also, for some reason I can only seem to bring in the image from the first product (‘0’) and that then repeats so it shows for the wrong items. I know it’s because the variable is wrong, but I’ve played with iterations of what I think it should be and it doesn’t work. I’ve tried:

  • {{ event.extra.line_items.product.images.src }}
  • {{ item.product.images.src }}
  • {{ event.extra.line_items.product.images.url }}
  • {{ item.product.images.src }}

I can see people have had similar problems, but the ‘solutions’ are either generic, not for these problems or don’t work.

TIA

Beth

icon

Best answer by JessFosnough 20 May 2024, 19:23

View original

5 replies

Userlevel 5
Badge +23

Hi @bethcox ,

Are you using a dynamic table, as well as specifying content repeat rules under the display section? if so, that *might* be why your content is repeating - I believe if you use one, you don’t need the other. For example, I use a dynamic table to populate abandoned cart emails, and do not use the content repeat rules under the display section.

Let me know if this helps!

Badge

Hi @bethcox ,

Are you using a dynamic table, as well as specifying content repeat rules under the display section? if so, that *might* be why your content is repeating - I believe if you use one, you don’t need the other. For example, I use a dynamic table to populate abandoned cart emails, and do not use the content repeat rules under the display section.

Let me know if this helps!

Hi,

Ah okay. So I put in a content repeat because when I was going through the steps that was what was suggested in order to get all the products to display - or that’s what I thought it was suggesting.

I.e. I thought if someone abandoned multiple items, and the repeat wasn’t there, it would only show the first item. I’ve just removed the repeat as suggested and that worked, thank you! 

Now I just need to solve the image issue and I’ll be sorted 😅

Thanks again,

Beth

Userlevel 5
Badge +23

 

Oh good, I’m glad that helped the repeat issue.

When you go to preview the email for a customer, in the event info, is there an image field? If so, you should be able to hover over and copy the variable. Then, copy that info into the dynamic table image field, removing the part that is your row collection, and replace with row alias (I realize this is exactly what you read in the articles!).

Here are some screen shots from my account, just in case they help.

Row collection & alias for dynamic table

 

 

hovering over image variable for abandoned cart item

 

Image content block in dynamic table - click “replace” to update content
dynamic image variable, with row collection part removed, replaced by row alias

 

You *should* just be able to replace “ImageURL” with the field name for your product image, but things never seem to be as easy as they should be…

Good luck!

 

Badge

 

Oh good, I’m glad that helped the repeat issue.

When you go to preview the email for a customer, in the event info, is there an image field? If so, you should be able to hover over and copy the variable. Then, copy that info into the dynamic table image field, removing the part that is your row collection, and replace with row alias (I realize this is exactly what you read in the articles!).

Here are some screen shots from my account, just in case they help.

Row collection & alias for dynamic table

 

 

hovering over image variable for abandoned cart item

 

Image content block in dynamic table - click “replace” to update content
dynamic image variable, with row collection part removed, replaced by row alias

 

You *should* just be able to replace “ImageURL” with the field name for your product image, but things never seem to be as easy as they should be…

Good luck!

 

This has been incredibly helpful, and I’ve now got it sorted.

Thank you SO MUCH for taking the time to help me fix this issue 🙌

Have a wonderful day!

Beth

Userlevel 5
Badge +23

@bethcox - Awesome! So glad I could help!

Best of luck in all your marketing efforts!

Reply