block order_totals is not rendering custom block

connor_wilsonconnor_wilson Member
in Bugs & Feature Requests edited March 18
I have built a custom block to use for the order totals section of the cart page. The idea is to have a sidebar that is present through out the checkout process. Right now, it will load my block for a second, and then it will swap to the default block

I used the V2.0 templates that were on GitHub as a guide, but after looking through them for the last couple of hours, I can't find what is wrong.
I was able ot get other blocks that I had written to render, though
I can send the code to someone if need be
Comments
  • fc_marijafc_marija FoxyCart Team
    Hi @connor_wilson -

    Can you whisper us the store's domain? We'll take a look and see if we can figure out the issue.
  • and actually the design has changed, now they want a sidebar cart on their actual page, and then when they hit 'ready to check out' or whatever then we go to the checkout page. It seemed to me like it was either sidebar or the three templates
  • fc_adamfc_adam FoxyCart Team
    @connor_wilson,

    If your client is after a sidebar cart on their site, will our default Sidecart display work for their needs? That by default slides in from the side of the page and allows the customer to jump straight to the checkout.

    In terms of the original issue you were experiencing - that relates to a known limitation for the cart include template. Any blocks from within the cart include template need to be overwritten from the cart include template directly. When a dynamic re-render happens of any of those blocks, it will pull the block from the cart include, rather than one that may be defined on a different template like the full page cart or checkout templates.

    While it will render your custom blocks on page load from server-side, any dynamic rendering in the JS will pull the blocks from the cart include.

    Sorry for any confusion and time spent there. I hope that helps!
  • Okay, huh, thats interesting! And you are right the sidebar for the product page will work fine, but they are also hoping for a sidebar in the checkout process that will contain a cart overview.

    So just to make sure I understand before I move on: It doesn't matter what I put into the custom template, as long as there is a block/chunk on your side that is rendered dynamically, it will override whatever I have written in the cached version of my template.

    Now does that mean that I can include a sidebar in my cart.inc.twig and as long as I don't call your default responsive cart.inc.twig, I can then include it anywhere I want in other template, is that right?
  • fc_adamfc_adam FoxyCart Team
    @connor_wilson,
    And you are right the sidebar for the product page will work fine, but they are also hoping for a sidebar in the checkout process that will contain a cart overview.
    Our default template for the checkout includes a sidebar with the cart present with editable quantity fields - would that meet the requirements for the client? Or are they looking for some specific aspects that our default template doesn't include?
    So just to make sure I understand before I move on: It doesn't matter what I put into the custom template, as long as there is a block/chunk on your side that is rendered dynamically, it will override whatever I have written in the cached version of my template.
    When it comes to the cart include template on the full-page cart and checkout, yes that's correct. If you try to overwrite a cart include block on the full page cart or checkout template, any dynamic re-render of that block will revert it to the version found in the cart include template.

    If you're looking to make customisations to the cart template, your best bet would be to work within the cart include template.

    If you'd like - if you send through some screenshots/mockups of the type of layout you're looking to achieve to our helpdesk - we can give you some more specific pointers of how you could approach the customisations.
  • connor_wilsonconnor_wilson Member
    edited March 20
    It's very hard to put into words, isn't it?

    The default sidebar is good, I just need to change some of the styling of it and maybe a few elements in there, but that shouldn't be too hard.

    But I certainly wouldn't turn down some pointers, I sent some links to our basecamp for you to check out the files. There's a psd, but I've also included png versions of each step
Sign In or Register to comment.