These are chat archives for reactioncommerce/reaction

14th
Apr 2015
Everest Liu
@evliu
Apr 14 2015 01:22
has anyone tried to get session variables from a iron router route function? (client side route)
Aaron Judd
@aaronjudd
Apr 14 2015 03:09
@evliu yes...
Goutham Veeramachaneni
@gouthamve
Apr 14 2015 13:08
Are the localisation settings in the dashboard working? When I change currency to INR (₹) it still shows $
Aaron Judd
@aaronjudd
Apr 14 2015 13:57
@Gouthamve where in the dashboard?
(yes should be working), check that formatPrice is used
Goutham Veeramachaneni
@gouthamve
Apr 14 2015 14:10
Screen Shot 2015-04-14 at 7.39.33 pm.png
The price was divided by 60 (for INR) but still $ is shown for currency symbol.
Aaron Judd
@aaronjudd
Apr 14 2015 14:16
ok I see the same, not sure, but seeing the same with other currencies - I’ll take a look
(just the symbol seems to not be applied)
Goutham Veeramachaneni
@gouthamve
Apr 14 2015 14:21
Okay. I will add the history option for notes. I will be committing to the existing PR.
Aaron Judd
@aaronjudd
Apr 14 2015 14:21
ok I won’t merge until you say so… looking good though!
Aaron Judd
@aaronjudd
Apr 14 2015 14:48
@Gouthamve I created #366 to track the currency issue
Everest Liu
@evliu
Apr 14 2015 15:58
Any idea why if I set a Session variable in a template event, it’s not there when i try toSession.getit in another route?
Spencer Norman
@spencern
Apr 14 2015 16:01
Can you give some context?
Aaron Judd
@aaronjudd
Apr 14 2015 16:01
@evliu no idea, but things I’d look at: the timing of the hook (maybe try onBeforeAction) and Session.get is reactive and will force a ‘reactive cascade’, so context is important there
Everest Liu
@evliu
Apr 14 2015 16:06
yea definitely. i have an event that Session.set(‘someInfo’, theInfo), then a third party API is hit and brings up a light box on the page. after the light box operation is done by the user, the 3rd party calls a callback URL, which I have rendered on the same page, and that route basically tries to `Session.get(‘someInfo’) and closes the lightbox
i get undefined
Aaron Judd
@aaronjudd
Apr 14 2015 16:07
did you see the comment on the commit I made yesterday for paypal-express?
something like that?
Everest Liu
@evliu
Apr 14 2015 16:07
when i console.log(Session.keys), it has the same sessionId, but it doesn’t have my session variable
i didn’t see it, i’ll take a look
Spencer Norman
@spencern
Apr 14 2015 16:13
Have you verified that when you call session.set('someInfo', theInfo) that it's actually getting stored?
Everest Liu
@evliu
Apr 14 2015 16:13
yep, if i do Session.keys in the browser, it shows it to me
if i console.log from the router function, it doens’t have it
Router.route(‘/return’, function() {
     console.log(Session.get(‘someInfo’);
}
Aaron Judd
@aaronjudd
Apr 14 2015 16:15
have you tried sessionValue = Session.get “someInfo”
Everest Liu
@evliu
Apr 14 2015 16:15
hmm, i’ll try it out
Aaron Judd
@aaronjudd
Apr 14 2015 16:17
well in the log example it should work, but sometimes when used in a conditional i’ll do it that way - can’t really back this up, but seems more reliable, and triggers the conditional as expected on change
Everest Liu
@evliu
Apr 14 2015 16:18
hmm, i’m not doing it in a conditional, and still got undefined
maybe i’ll try attaching it to one of the collections
so weird… when I do it in chrome console, i get my info
do Session variables persist across different tabs? maybe i should check that
i think i’ll just persist it to a collection
Aaron Judd
@aaronjudd
Apr 14 2015 16:25
I don’t think sessions will persist across tabs or browsers - we do some tricks to sync everything up (like rebuilding the cart from the collection)
Vlatko Koudela
@vkoudela
Apr 14 2015 16:25
as far as I know, session vars doesn’t persist across different tabs
Everest Liu
@evliu
Apr 14 2015 16:28
hmm, that is probably my issue then. the route is being called within an iFrame I think
Spencer Norman
@spencern
Apr 14 2015 16:28
Is it on the same domain?
Everest Liu
@evliu
Apr 14 2015 16:30
it is after the callback, it loads the returnUrl into the iFrame
Spencer Norman
@spencern
Apr 14 2015 16:30
You could try using localStorage instead of sessionStorage to see if it's actually a session issue
Everest Liu
@evliu
Apr 14 2015 16:30
iFrame was created with third-party js library
Spencer Norman
@spencern
Apr 14 2015 16:31
localStorage.setItem('item', 'stuff') / localStorage.getItem('item', 'stuff')
Everest Liu
@evliu
Apr 14 2015 16:31
i think it is as they said, the session variable isn’t persisting across different browser instances
Aaron Judd
@aaronjudd
Apr 14 2015 16:31
the trick to remember is that Sessions is not a ‘session’
Spencer Norman
@spencern
Apr 14 2015 16:31
oh?
special Meteor session?
Everest Liu
@evliu
Apr 14 2015 16:32
yea, i think that’s what i’m realizing. it’s funny because the SessionID is the same though
or is that just a reaction thing?
Aaron Judd
@aaronjudd
Apr 14 2015 16:32
it’s a reactive variable, and not persistent in any way that a session would be -> i have no idea why they named it Sessions
that’s a meteor thing
Everest Liu
@evliu
Apr 14 2015 16:32
got it
Aaron Judd
@aaronjudd
Apr 14 2015 16:32
the ServerSessions is a reaction thing
and that is persistent (and a collection as well ‘Sessions’)
Everest Liu
@evliu
Apr 14 2015 16:32
so they should have called it meteorStorage or something?
Aaron Judd
@aaronjudd
Apr 14 2015 16:33
which uses localstorage
(amplify)
Spencer Norman
@spencern
Apr 14 2015 16:33
good to know
Aaron Judd
@aaronjudd
Apr 14 2015 16:33
well they should have called it ReactiveVar - which they now have - > but it’s local and not global (like Sessions)
Everest Liu
@evliu
Apr 14 2015 16:34
hmm, if Sessions collection doesn’t have a schema, maybe i’ll attach to that? haha
Aaron Judd
@aaronjudd
Apr 14 2015 16:34
cough you could…..
Everest Liu
@evliu
Apr 14 2015 16:36
lol, i’m just guessing attaching to any collection with a Schema would fail check(), but I can always create a collection as a well
Aaron Judd
@aaronjudd
Apr 14 2015 16:36
but I think @spencern approach could work
Everest Liu
@evliu
Apr 14 2015 16:36
hmm, just thinking if the user creates two tabs and are doing two different things, then it could get messy
but i guess i could prepend the key with the sessionId as well to namespace it
Spencer Norman
@spencern
Apr 14 2015 16:37
localStorage should persist across tabs
Everest Liu
@evliu
Apr 14 2015 16:38
not sure if i would want it to, that’s what i mean
Spencer Norman
@spencern
Apr 14 2015 16:38
ah
Everest Liu
@evliu
Apr 14 2015 16:38
i really only need it in the iFrame that is on the page which has the session variable, lol…
if it could only reach outside of itself and get that… or i could inject it from the container
i tried attaching it to the returnUrl also, but then realized that the information i generate comes from the initial call where i provide the returnUrl
Aaron Judd
@aaronjudd
Apr 14 2015 16:47
I think you’re likely to run into some security issues here as well…
what about passing the variable into the src url of the iframe?
Everest Liu
@evliu
Apr 14 2015 16:49
i don’t have any control over the iframe… the joy of 3rd party js libraries...
well, actually, i might be able to modify the 3rd party js file… it’s just minimized -_-
and it calls the returnUrl, so when i need it, it’s already set to the returnUrl, in which i wanted to add as a URL parameter, but i have to set the returnUrl before i get the info i would need to append as a URL param
Aaron Judd
@aaronjudd
Apr 14 2015 16:51
is this paypal related?
Everest Liu
@evliu
Apr 14 2015 16:51
yep, boss wants a custom implementation
i think i’ll just need to use localStorage
Aaron Judd
@aaronjudd
Apr 14 2015 16:52
express is now working, not sure if there are some ideas there - I’m guessing you don’t want the popup and are trying to include the sign-in inline...
Everest Liu
@evliu
Apr 14 2015 16:53
originally was using paypal SSO, but because we’d be paying out to different sellers, we don’t want to get double-charged by paypal commission
Aaron Judd
@aaronjudd
Apr 14 2015 16:54
all I can say is.. “grrr. paypal"
Everest Liu
@evliu
Apr 14 2015 16:54
serious...
Goutham Veeramachaneni
@gouthamve
Apr 14 2015 16:59
Added the history option. Do you need the option of looking at the history? As of now every note-change is logged in history but only the latest note is shown.
Aaron Judd
@aaronjudd
Apr 14 2015 17:13
@Gouthamve I think that’s an acceptable first pass - I’m sure we’ll want to be able to see more - I see this being something that the customer could add to as well - so you’d want that back and forth dialogue history
Goutham Veeramachaneni
@gouthamve
Apr 14 2015 17:15
Then, I think you can merge the PR now.
But that dialogue needs to be through mail also. I think #290 deals with it
Aaron Judd
@aaronjudd
Apr 14 2015 17:17
:thumbsup:
Goutham Veeramachaneni
@gouthamve
Apr 14 2015 17:30
I am seeing the orders of others in the Admin profile. Was it intentional?
I bought stuff as guest and registered user and those orders were on the Profile of the admin.
Aaron Judd
@aaronjudd
Apr 14 2015 20:47
(yes admin should see all)
Spencer Norman
@spencern
Apr 14 2015 21:04
@aaronjudd, added a couple issues: #367 which addresses the use-case for multiple variants per product, and #368 which addresses the need for bundling of products.