We have a rails application mounted with Spreecommerce as Rails::Engine and hosted at dashboard.domainname.com
and available through dashboard.domainname.com/store
then we have the wordpress for front-end implemented at www.domainname.com
.
We now need to show the checkout amount and quantity in the wordpress side of the application. Clicking on this would lead to checkout of the rails application itself so won't be problem for there on.
*Note: Please consider that a user can add products to cart even without signing in.
Use secure/encrypted cookies to share cart details with wordpress and rails,
How do we achieve this?
Use cookies, Storing an encrypted cookie with Rails, http://api.rubyonrails.org/classes/ActionDispatch/Session/CookieStore.html
Is it accessible through cookies?
Yes, refer above answer.
If so how can it be shared throughout different sub-domains?
cookies.signed[:secret] # returns "foo bar"
Tutorial, Here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With