1

I am trying to display different information on the order complete page, based on the used gateway. I have something like this at the moment:

{if authorized}

    {if {payment_gateway} == ct_offline_payments}

    Display this

    {/if}

    {if {payment_gateway} == paypal_express}

    Display that

    {/if}
{/if}

This however results in both blocks being displayed. I tried a lot of differnt syntax variations, some resulting in displaying nothing at all, some in displaying both and I just can't get it right.

Any ideas? Thanks and Cheers,

Marc

EDIT/UPDATE: Thanks Alex, but unfortunately this isn't working for me.

I have this code right now:

{!-- set the page layout --}
{stash:embed:layouts:standard}

{exp:stash:set name="page-title" parse_tags="yes"}Bestellung abgeschlossen. Vielen Dank für Ihren Einkauf bei FOXGEAR!{/exp:stash:set}

{exp:stash:set name="body_id"}abgeschlossen{/exp:stash:set}

{!-- main page variables --}
{exp:stash:set name="maincontent" parse_tags="yes"}

{if no_results OR segment_4!=""}{redirect="404"}{/if}
            <div id="content">

                <div>
                    {exp:cartthrob:submitted_order_info dec_point="," thousands_sep="."}

                    {order_payment_gateway}

                    {if order_payment_gateway == "ct_offline_payments"}
                        Offline
                    {if:elseif order_payment_gateway == "paypal_express"}
                        PayPal
                    {if:else}
                        Other
                    {/if}

                    {/exp:cartthrob:submitted_order_info}
                </div>

                <div class="clear"></div>

            </div><!-- /content -->
{/exp:stash:set}

And the rendered page outputs this (in content div):

{order_payment_gateway} Other

That's it. Nothing else (header and footer working fine). :(

3
  • What version of EE and of CartThrob are you using?
    – Alex Kendrick
    Jan 6 '14 at 16:12
  • 1
    It sounds like {order_payment_gateway} just isn't being parsed so that's why the condition is never met. To solve this we need to figure out why this variable is not being parsed. Could it be that it does not exist or has a different name in the version of CT you are using?
    – Alex Kendrick
    Jan 6 '14 at 16:22
  • 1
    Yes, you were spot on. Sorry my bad. The fields name is actually {payment_gateway_field}.
    – Marc
    Jan 6 '14 at 16:41
2

I have a conditional based on order_payment_gateway in my receipt template and this works for me when used within the exp:cartthrob:submitted_order_info tag:

{if order_payment_gateway == "ct_offline_payments"}ACH{if:else}Card{/if}

So building from that you could try...

{if order_payment_gateway == "ct_offline_payments"}
    Offline
{if:elseif order_payment_gateway == "paypal_express"}
    PayPal
{if:else}
    Other
{/if}

I suggest outputting {order_payment_gateway} in your template so you can double-check that "paypal_express" really is the correct value to test against.

1
  • Not working. Please see my update.
    – Marc
    Jan 6 '14 at 16:03

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.