Abandoned Cart Item display none | Community
Skip to main content
Fabiannb
Level 2
July 15, 2022
Question

Abandoned Cart Item display none

  • July 15, 2022
  • 2 replies
  • 4131 views

Hi,

I'm using a custom object to create an abandoned cart email within the following
token by each item. 
{{my.Abandon Cart Item 1:default=}}

However, I can't hide (display:none) the token if there is no information. What is the best way to hide the tokens when are not populated? CSS, velocity script, some token default = something

 

I'll appreciate a lot your help 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Darshil_Shah1
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
July 15, 2022

Well, you can add that logic in the velocity script that you're using to output the CO data itself. I'd worked on an abandoned cart email implementation in past where-in we triggered-off the email from Marketo upon addition of the CO record (we still added the conditions in velocity to ensure that the right data is present in the CO record as a fail-safe measure).

 

SanfordWhiteman
Level 10
July 15, 2022

I'm using a custom object to create an abandoned cart email within the following
token by each item. 
{{my.Abandon Cart Item 1:default=}}


You can’t be using a Custom Object here, or you’d already need to be using Velocity to output it?

 

Do you mean you’re just populating fields with custom data?

Fabiannb
FabiannbAuthor
Level 2
July 15, 2022

Yes, I'm getting the data through Magento by a custom object then I use the script to show the data in the email template. 

SanfordWhiteman
Level 10
July 15, 2022

Your response isn’t clear, but again if you’re already using Velocity you have full control over what’s output from your code (and the :default= syntax doesn’t work with Velocity tokens, btw).

 

A Velocity {{my.token}} need not have any output at all. That’s the way we usually break up large VTL projects, where some tokens are included to do looping/sorting/filtering and other tokens do the output.