-1

I have an issue and its kind of a challenging one. So I have an email that is translated into 9 languages. I use AMPscript to fire off which language to use based on a user's lang pref in the system.

The issue I am having is, we have digital products and shippable products. Obviously I do not want it to show a Shipping Address Text Label for a digital download product we offer when totaling the order.

Is this a behind the scenes issue that should be dealt with through the Carts framework using CSS, or can this be handled from the email side within SFMC to decide when to show it or not?

Here is the code:

<!-- Content Block 4UX -->
%%[

    VAR @CartItemsJson
    VAR @CartDiscountsJson
    VAR @CartDonationsJson

    SET @CartItemsJson = Items
    SET @CartDiscountsJson = Discounts
    SET @CartDonationsJson = Donations

]%%

{{.dataobject CartItem type=variable source=@CartItemsJson}}
    {{.data}}
        {"target":"@CartItemsJson"}
    {{/data}}
{{/dataobject}}
{{.dataobject CartDiscount type=variable source=@CartDiscountsJson}}
    {{.data}}
        {"target":"@CartDiscountsJson"}
    {{/data}}
{{/dataobject}}
{{.dataobject CartDonation type=variable source=@CartDonationsJson}}
    {{.data}}
        {"target":"@CartDonationsJson"}
    {{/data}}
{{/dataobject}}

<table bgcolor="#E8E8E8" border="0" cellpadding="0" cellspacing="0" class="em_full_wrap" width="100%">
    <tr>
        <td align="center" valign="top">
            <table align="center" border="0" cellpadding="0" cellspacing="0" class="em_main_table" style="width:600px; table-layout:fixed;" width="600">
                <tr>
                    <td align="center" bgcolor="#ffffff" class="em_aside15" style="padding:0px 40px;" valign="top">
                        <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                            <tr>
                                <td class="em_h20" height="42" style="font-size:1px; line-height:1px; height:42px;">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td align="left" class="em_defaultlink" style="font-family: Arial, Helvetica, sans-serif, 'Noto Sans'; font-size:18px; line-height:28px; color:#212121;font-weight:bold; padding-bottom:17px;" valign="top">
                                    Order Summary
                                </td>
                            </tr>
                            <tr>
                                <td align="center" valign="top">

                                    {{#each CartItem}}
                                        <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                            <tr>
                                                <td align="left" style="padding-bottom:20px;" valign="top">
                                                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                        <tr>
                                                            <td align="left" class="em_defaultlink" style="font-family: Arial, Helvetica, sans-serif, 'Noto Sans'; font-size:14px; line-height:17px; color:#404040;" valign="top">
                                                                {{ItemShortDescription}}
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                                <td style="width:10px;font-size:0px; line-height:0px;" width="10">
                                                    <img alt="" border="0" height="1" src="http://image.email.XXXXX/lib/fe3d1570756405797d1672/m/1/ca84d697-b3c3-4e2e-9365-7b501b7ab092.gif" style="display:block;" width="1">
                                                </td>
                                                <td align="right" class="em_defaultlink" style="font-family: Arial, Helvetica, sans-serif, 'Noto Sans'; font-size:14px; line-height:17px; color:#212121;" valign="top" width="100">
                                                    {{ItemPrice}}
                                                </td>
                                            </tr>
                                        </table> 
                                    {{/each}} 

                                    {{if CartDonation}} 

                                        {{#each CartDonation}}
                                            <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                <tr>
                                                    <td align="left" style="padding-bottom:20px;" valign="top">
                                                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                            <tr>
                                                                <td align="left" class="em_defaultlink" style="font-family: Helvetica, Arial, sans-serif; font-size:14px; line-height:17px; color:#404040;" valign="top">
                                                                    {{ItemShortDescription}}
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                    <td style="width:10px;font-size:0px; line-height:0px;" width="10">
                                                        <img alt="" border="0" height="1" src="http://image.email.XXXXX/lib/fe3d1570756405797d1672/m/1/ca84d697-b3c3-4e2e-9365-7b501b7ab092.gif" style="display:block;" width="1">
                                                    </td>
                                                    <td align="right" class="em_defaultlink" style="font-family: Helvetica, Arial, sans-serif; font-size:14px; line-height:17px; color:#404040;" valign="top" width="100">
                                                        {{ItemPrice}}
                                                    </td>
                                                </tr>
                                            </table> 
                                        {{/each}} 

                                    {{/if}}
                                </td>
                            </tr>
                            <tr>
                                <td bgcolor="#212121" height="1" style="font-size:0px; line-height:0px; height:1px;">
                                    <img alt="" border="0" height="1" src="http://image.email.XXXXX/lib/fe3d1570756405797d1672/m/1/ca84d697-b3c3-4e2e-9365-7b501b7ab092.gif" style="display:block;" width="1">
                                </td>
                            </tr>
                            <tr>
                                <td class="em_h20" height="15" style="font-size:1px; line-height:1px; height:15px;">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td align="center" valign="top">
                                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                        <tr>
                                            <td align="left" class="em_defaultlink" style="font-family: Helvetica, Arial, sans-serif; font-size:14px; line-height:17px; color:#404040;" valign="top">
                                                Subtotal
                                            </td>
                                            <td style="width:10px;font-size:0px; line-height:0px;" width="10">
                                                <img alt="" border="0" height="1" src="http://image.email.XXXXX/lib/fe3d1570756405797d1672/m/1/ca84d697-b3c3-4e2e-9365-7b501b7ab092.gif" style="display:block;" width="1">
                                            </td>
                                            <td align="right" class="em_defaultlink" style="font-family: Helvetica, Arial, sans-serif; font-size:14px; line-height:17px; color:#404040;" valign="top" width="100">
                                                %%SUBTOTAL%%
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td height="10" style="font-size:1px; line-height:1px;">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td align="center" valign="top">
                                    {{if CartDiscount}}

                                        {{#each CartDiscount}}
                                            <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                <tr>
                                                    <td align="left" class="em_defaultlink" style="font-family: Helvetica, Arial, sans-serif; font-size:14px; line-height:17px; color:#404040;" valign="top">
                                                        {{ItemShortDescription}}
                                                    </td>
                                                    <td style="width:10px;font-size:0px; line-height:0px;" width="10">
                                                        <img alt="" border="0" height="1" src="http://image.email.XXXXX/lib/fe3d1570756405797d1672/m/1/ca84d697-b3c3-4e2e-9365-7b501b7ab092.gif" style="display:block;" width="1">
                                                    </td>
                                                    <td align="right" class="em_defaultlink" style="font-family: Helvetica, Arial, sans-serif; font-size:14px; line-height:17px; color:#404040;" valign="top" width="100">
                                                        {{ItemPrice}}
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td height="10" style="font-size:1px; line-height:1px;">
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                            </table> 
                                        {{/each}}

                                    {{/if}}
                                </td>
                            </tr>
                            <tr>
                                <td align="center" valign="top">
                                    %%[ IF NOT EMPTY(TAX) THEN ]%%
                                        <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                            <tr>
                                                <td align="left" class="em_defaultlink" style="font-family: Helvetica, Arial, sans-serif; font-size:14px; line-height:17px; color:#404040;" valign="top">
                                                    Tax
                                                </td>
                                                <td style="width:10px;font-size:0px; line-height:0px;" width="10">
                                                    <img alt="" border="0" height="1" src="http://image.email.XXXXX/lib/fe3d1570756405797d1672/m/1/ca84d697-b3c3-4e2e-9365-7b501b7ab092.gif" style="display:block;" width="1">
                                                </td>
                                                <td align="right" class="em_defaultlink" style="font-family: Helvetica, Arial, sans-serif; font-size:14px; line-height:17px; color:#404040;" valign="top" width="100">
                                                    %%TAX%%
                                                </td>
                                            </tr>
                                            <tr>
                                                <td height="10" style="font-size:1px; line-height:1px;">
                                                    &nbsp;
                                                </td>
                                            </tr>
                                        </table> 
                                    %%[ ENDIF ]%%
                                </td>
                            </tr>
                            <tr>
                                <td align="center" valign="top">

                                    %%[ IF NOT EMPTY(SHIPPING) THEN]%%

                                        <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                            <tr>
                                                <td align="left" class="em_defaultlink" style="font-family: Helvetica, Arial, sans-serif; font-size:14px; line-height:17px; color:#404040;" valign="top">
                                                    Shipping
                                                </td>
                                                <td style="width:10px;font-size:0px; line-height:0px;" width="10">
                                                    <img alt="" border="0" height="1" src="http://image.email.XXXXX/lib/fe3d1570756405797d1672/m/1/ca84d697-b3c3-4e2e-9365-7b501b7ab092.gif" style="display:block;" width="1">
                                                </td>
                                                <td align="right" class="em_defaultlink" style="font-family: Helvetica, Arial, sans-serif; font-size:14px; line-height:17px; color:#404040;" valign="top" width="100">
                                                    %%SHIPPING%%
                                                </td>
                                            </tr>
                                        </table>

                                    %%[ ENDIF ]%%
                                </td>
                            </tr>
                            <tr>
                                <td height="10" style="font-size:1px; line-height:1px;">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td align="center" valign="top">
                                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                        <tr>
                                            <td align="left" class="em_defaultlink" style="font-family: Helvetica, Arial, sans-serif; font-size:14px; line-height:17px; color:#212121;" valign="top">
                                                <strong>TOTAL</strong>
                                            </td>
                                            <td style="width:10px;font-size:0px; line-height:0px;" width="10">
                                                <img alt="" border="0" height="1" src="http://image.email.XXXXX/lib/fe3d1570756405797d1672/m/1/ca84d697-b3c3-4e2e-9365-7b501b7ab092.gif" style="display:block;" width="1">
                                            </td>
                                            <td align="right" class="em_defaultlink" style="font-family: Helvetica, Arial, sans-serif; font-size:14px; line-height:17px; color:#212121;" valign="top" width="100">
                                                <strong>%%TOTAL%%</strong>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td class="em_h20" height="38" style="font-size:1px; line-height:1px; height:36px;">&nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="em_h20" height="40" style="font-size:1px; line-height:1px; height:40px;">&nbsp;</td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<!-- //Content Block 4UX -->

Second block

<!-- Content Block 4UX -->
<table bgcolor="#E8E8E8" border="0" cellpadding="0" cellspacing="0" class="em_full_wrap" width="100%">
    <tr>
        <td align="center" valign="top">
            <table align="center" border="0" cellpadding="0" cellspacing="0" class="em_main_table" style="width:600px; table-layout:fixed;" width="600">
                <tr>
                    <td align="center" bgcolor="#ffffff" class="em_aside15" style="padding:0px 40px;" valign="top">
                        <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                            <tr>
                                <td class="em_h20" height="42" style="font-size:1px; line-height:1px; height:42px;">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td align="left" class="em_defaultlink" style="font-family:Arial, Helvetica, sans-serif, 'Noto Sans'; font-size:18px; line-height:28px; color:#000000;font-weight:bold; padding-bottom:17px;" valign="top">
                                    Customer Information
                                </td>
                            </tr>
                            <tr>
                                <td align="center" valign="top">
                                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                        <tr>
                                            <td align="left" style="padding-bottom:10px;" valign="top">
                                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                    <tr>
                                                        <td align="left" class="em_defaultlink" style="font-family: Arial, Helvetica, sans-serif, 'Noto Sans'; font-size:14px; line-height:17px; color:#000000;" valign="top">
                                                            <b>Billing Address</b>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td style="width:10px;font-size:0px; line-height:0px;" width="10">
                                                <img alt="" border="0" height="1" src="http://image.email.XXXXX/lib/fe3d1570756405797d1672/m/1/ca84d697-b3c3-4e2e-9365-7b501b7ab092.gif" style="display:block;" width="1">
                                            </td>
                                            <td align="left" class="em_defaultlink" style="font-family: Arial, Helvetica, sans-serif, 'Noto Sans';font-size:14px; line-height:18px; color:#000000;" valign="top" width="230">
                                                <b>Shipping Address</b>
                                            </td>
                                        </tr>
                                    </table>
                                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                        <tr>
                                            <td align="left" style="padding-bottom:20px;" valign="top">
                                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                    <tr>
                                                        <td align="left" class="em_defaultlink" style="font-family: Arial, Helvetica, sans-serif, 'Noto Sans'; font-size:14px; line-height:17px; color:#404040;" valign="top">
                                                            %%BILLING_FIRST_NAME%% %%BILLING_LAST_NAME%%<br>
                                                            %%BILLING_ADDRESS%%<br>
                                                            %%BILLING_CITY%% %%BILLING_STATE%%<br>
                                                            %%BILLING_POSTAL%%<br>
                                                            %%BILLING_COUNTRY%%
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td style="width:10px;font-size:0px; line-height:0px;" width="10">
                                                <img alt="" border="0" height="1" src="http://image.email.xxxxxx.com/lib/fe3d1570756405797d1672/m/1/ca84d697-b3c3-4e2e-9365-7b501b7ab092.gif" style="display:block;" width="1">
                                            </td>
                                            <td align="left" class="em_defaultlink" style="font-family: Arial, Helvetica, sans-serif, 'Noto Sans'; font-size:14px; line-height:18px; color:#404040;" valign="top" width="230">
                                                %%SHIPPING_FIRST_NAME%% %%SHIPPING_LAST_NAME%%<br>
                                                %%SHIPPING_ADDRESS%%<br>
                                                %%SHIPPING_CITY%% %%SHIPPING_STATE%%<br>
                                                %%SHIPPING_POSTAL%%<br>
                                                %%SHIPPING_COUNTRY%%<br>
                                                &nbsp;
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" valign="top">
                                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                        <tr>
                                            <td align="left" style="padding-bottom:10px;" valign="top">
                                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                    <tr>
                                                        <td align="left" class="em_defaultlink" style="font-family: Arial, Helvetica, sans-serif, 'Noto Sans'; font-size:14px; line-height:17px; color:#000000;" valign="top">
                                                            <b>Payment Method</b>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td style="width:10px;font-size:0px; line-height:0px;" width="10">
                                                <img alt="" border="0" height="1" src="http://image.email.XXXXXX.com/lib/fe3d1570756405797d1672/m/1/ca84d697-b3c3-4e2e-9365-7b501b7ab092.gif" style="display:block;" width="1">
                                            </td>
                                            <td align="left" class="em_defaultlink" style="font-family: Arial, Helvetica, sans-serif, 'Noto Sans'; font-size:14px; line-height:18px; color:#000000;" valign="top" width="230">
                                                <b>Shipping Method</b>
                                            </td>
                                        </tr>
                                    </table>
                                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                        <tr>
                                            <td align="left" valign="top">
                                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                    <tr>
                                                        <td align="left" class="em_defaultlink" style="font-family: Arial, Helvetica, sans-serif, 'Noto Sans'; font-size:14px; line-height:17px; color:#404040;" valign="top">
                                                            <p>
                                                                %%PAYMENT_METHOD%%<br>
                                                                &nbsp;
                                                            </p>
                                                            <p>
                                                                <span style="font-size:14px;"><b>Total</b></span><span style="font-size:16px;">:&nbsp;</span><strong>%%TOTAL%%</strong>
                                                            </p>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td style="width:10px;font-size:0px; line-height:0px;" width="10">
                                                <img alt="" border="0" height="1" src="http://image.email.XXXXXX.com/lib/fe3d1570756405797d1672/m/1/ca84d697-b3c3-4e2e-9365-7b501b7ab092.gif" style="display:block;" width="1">
                                            </td>
                                            <td align="left" class="em_defaultlink" style="font-family: Arial, Helvetica, sans-serif, 'Noto Sans'; font-size:14px; line-height:18px; color:#404040;" valign="top" width="230">
                                                %%SHIPPING_METHOD%%
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td class="em_h20" height="38" style="font-size:1px; line-height:1px; height:36px;">
                                    &nbsp;
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="em_h20" height="40" style="font-size:1px; line-height:1px; height:40px;">
                        &nbsp;
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<!-- //Content Block 4UX -->

Any thoughts would be greatly appreciated, thanks.

  • 1
    MarTech Guy, which variable defines whether this is a digital product or a shippable product? – zuzannamj Jan 14 at 8:08
  • 1
    Is %%SHIPPING%% the value used to determine a DIGITAL or SHIPPABLE product? If so, what are the values in the %%SHIPPING%% field? You are using %%[ IF NOT EMPTY(SHIPPING) THEN]%% in your first block - what does EMPTY represent in this field? – Cameron Robert Jan 14 at 9:55
  • No, the %%shipping%% value is from our inhouse dev store and there are no variables defined to determine digital or shipping. Thats why i figured this should be handled through the stores backend. – MarTech Guy Jan 14 at 17:24
  • Can you update your question with some sample values for the SHIPPING attribute? – Adam Spriggs Jan 21 at 3:40
  • If you want to hide/show content, then you'll need to identify a variable and value to drive the if-then statements. You already have that in your code. We can't really help you without any details about the values in your send context. – Adam Spriggs Jan 21 at 3:50

Your Answer

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

Browse other questions tagged or ask your own question.