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.

What is the correct twig context for the full page cart?

I am trying to output something when the context is the full page cart ONLY. Basically I want to add an asterisk to the Order Total (what I have relabeled on the cart as Order Subtotal) which refers to a note under the cart which makes clear that a shipping cost will be added at checkout (our cart does not add or calculate shipping on the cart itself but only at checkout - at least for now though that may change).

As a step in that direction I have added the following snippet of twigglized (is that a word? LOL) code into the cart include template.


{% if context == 'cart' %}
{% if cart_is_fullpage %}
<td><p>Hi there</p></td>
{% endif %}
{% endif %}


I am simply adding an extra column after the Order Total column and outputting "Hi there".

But...it's not working.

I have tried just the cart context (without the cart_is_fullpage if / endif) and just the cart_is_fullpage if /endif but in all cases nothing is output in line with the code above.

When I cache the cart include template through the FoxyCart admin interface it shows up in the template code and it caches just fine without any errors but nothing appears on the screen to the affect of "Hi there".

That phrase doesn't even appear in the code of the resultant cart page.

So my twig must be off somehow.

How do I output "Hi there" (as an example) ONLY when the cart is displayed and ONLY when it is a full page cart?

Any input on a solution to this would be a appreciated.

I am whispering a URL through which you can view the cart where the above code is found in the cart include template.

Thanks.

Carlos
Comments
  • Oops. Never mind. I put that code into the wrong section (i.e. context) within the code. That's why it was never being rendered.

    No need for further input on this thread.

    Thanks.

    Carlos
  • fc_adamfc_adam FoxyCart Team
    @carlos123,

    Thanks for the update. For what it's worth - unless you're also doing an else statement for if it's not the full page cart, you can condense that logic to this:
    {% if context == 'cart' and cart_is_fullpage %}
    <td><p>Hi there</p></td>
    {% endif %}
  • Thanks Adam. Good tip.

    Carlos
Sign In or Register to comment.