I've written an AMPscript for showing up to 4 items in an abandoned cart email.

The script works fine but I still have an issue.

The text email should show the standard price AND the special price only when there's a special one.

Now in the HTML, I have the placeholder for a standard price and a special price. I wonder if there's a way for showing the Special price placeholder only when the special price field is populated.

Is there any documentation on this request?


You can achieve this by using if/else conditional statement. In below, you will have to add a source from which those prices are pulled from:

var @standardPrice, @specialPrice

set @standardPrice = ...
set @specialPrice = ...

if (not empty(@specialPrice) and not empty(@standardPrice)) then]%%

standardPrice: %%=v(@standardPrice)=%%
specialPrice: %%=v(@specialPrice)=%%

%%[elseif not empty(@specialPrice) then ]%%

standardPrice: %%=v(@standardPrice)=%%

| improve this answer | |

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.