Customizing cart.inc.twig in FoxyCart 2.0 possible?

pixelchutespixelchutes Member
in Help edited March 2015
What is the correct way to go about making customizations to cart.inc.twig?

When I replace {% include 'cart.inc.twig' %} with the contents of cart.inc.twig, I start receiving syntax errors attempting to cache my Checkout Twig:
There was a problem parsing your template: Your template was not saved because there was an error in your Twig template syntax:

The block 'logo' has already been defined line 391 in "TEMP_checkout_template.twig"

As the error states, this is defined twice:
First, in checkout.inc.twig ...then again in the included cart.inc.twig

Not sure how to get around this using the templates provided without dropping one of the "logo" blocks (forking from HEAD). Any thoughts? Seems to only impact people trying to use custom Twig templates.
Comments
  • pixelchutespixelchutes Member
    edited March 2015
    NOTE: I tried renaming the block to something unique, then got another error, this time for noscript_warning block.

    I just want to ensure I'm going about this the right way?

    UPDATE:

    Aha! I've gotten so used to changing code locally (+1 for Git!) that I forgot there is an option for modifying cart include template in the FC Admin.

    To confirm, is it not possible to refresh cart_include template_type via the API (store_template_cache) ? I'm trying to automate as much of the workflow as possible, and hoping to avoid having to login to FC Admin to refresh only the cart include template.
  • brettbrett FoxyCart Team
    @pixelchutes, it might be an oversight that we don't have the cart_include. We'll take a look.
  • brettbrett FoxyCart Team
    @pixelchutes, if you're trying to automate things, our new API might be useful. Ping me privately for more info about that. (We'll be doing a public beta VERY soon on it though.)
  • brettbrett FoxyCart Team
    edited April 2015
    @pixelchutes, we pushed out the cart_include via the (legacy) API a few days ago. Give it a look and let us know if you need help.
  • [message] => cart_include Template Updated
    Looks good, thanks guys!
  • @brett, is there currently an option for caching the text version of cart_include, as seen in the plain text email fallback? (e.g. cart.inc.txt.twig)

    More detail can be found in this post.
  • fc_adamfc_adam FoxyCart Team
    @pixelchutes,

    I just responded to your other thread - let's continue the discussion there.
Sign In or Register to comment.