The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Different wording between cart and checkout as in "Order Subtotal" and "Order Total"?

On the cart I have made the wording such that it shows "Order Subtotal" since...well...it would be incorrect to use the default "Order Total" since the cart does not show an actual order total in that we do not calculate or add in the shipping price on the store until the customer gets to checkout.

Of course on the checkout page the wording should be more appropriately be "Order Total" at that point but since what shows up in the sidebar where the wording is found is the cart...the wording I have changed the cart to continues to read "Order Subtotal".

What I want to do is have the "Order Subtotal" be the wording on the cart ONLY when it is full page and "Order Total" be the wording when it is displayed on the checkout page sidebar.

The admin interface does not give me the option to have different wording like that.

I tried to do the following in twig within the cart include template but automagic complained about the periods in the config variable names so I assume I can't set the config variables this way.



{# per Carlos: need different wording on full page cart vs when displayed in checkout sidebar
{% if context == 'cart' and cart_is_fullpage %}
{% set config.lang.cart_order_total = "Order Subtotal" %}
{% else %}
{% set config.lang.cart_order_total = "Order Total" %}
{% endif %}

{{ config.lang.cart_order_total|raw }}:


The following IS working but I am wondering if there is a cleaner or better way to do this?


{# per Carlos: need different wording on full page cart vs when displayed in checkout sidebar #}
{% if context == 'cart' and cart_is_fullpage %}
Order Subtotal:
{% else %}
Order Total:
{% endif %}
{# was {{ config.lang.cart_order_total|raw }}: #}


Carlos
Comments
  • fc_adamfc_adam FoxyCart Team
    @carlos123,

    Technically with either approach you're hard-coding the language strings - so if the second approach works for you, then that's ok.

    For what you're wanting to do though - Twig doesn't support periods in a variable name for set as you've noted there. There is a merge tag you can use - but for what you're doing the second approach would be fine.
  • Thanks Adam. I'll stick to what works then.

    Carlos
Sign In or Register to comment.