0

I have a Meteor application which is a POS system. Once a transaction has been completed a receipt is populated on screen, giving the user the option to print. As the receipt is an entire page in itself (for formatting to correct width etc) it is displayed in an iframe, so a different page to the page displayed for the Till.

Currently the receipt page is subscribing (using SubsManager) to the same collections as the Till page and extracting the data required to form the receipt however this feels very wrong. What I want to do is to simply create a JSON object in the till page containing all data required for the receipt, and just pass it to the receipt page. I'm struggling with how to actually do this though - my setup is using FlowRouter / Blaze. Thinking in a traditional server/client heretic approach I would simply have POSTed this data to the page but it doesn;t seem to be possible here. Is there a standard way to achieve this?

6
  • As far as I can see, you should be going well with the Session package. Commented Sep 27, 2017 at 9:53
  • From the docs though, Session doesn't survive a page refresh, seems to live in the context of a single page only so wouldn't work in this case as the receipt page is a totally new page being loaded (with a separate layout)? Commented Sep 27, 2017 at 10:23
  • Both your top page and iframe page are loading from the same domain, correct? Commented Sep 27, 2017 at 11:10
  • Yes, same domain Commented Sep 27, 2017 at 11:24
  • 1
    In that case, you could make your data a JSON string and store it in sessionStorage or localStorage of your browser. Commented Sep 27, 2017 at 11:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.