Modx Rev / Foxycart SSO

tsnekifoxtsnekifox Member
in Bugs & Feature Requests edited June 2011
I am sure this has been brought up before since I have spent the last hour looking through both the foxycart and the modx forums.

I have a functional store using modx and foxycart together. However I want to use the user's login on the modx site for sso with foxycart. This is where I have run into the problem. I have read through the documentation and understand the idea but not how to actually implement it.

Could anyone post or direct me to a checklist of what needs to be done and how to do it so the two to cooperate?
  • brettbrett FoxyCart Team
    Hi @tsnekifox.
    So, ... it's not really a quick answer, and it kind of depends on how you've set things up. Let's start with what you've got so far (if anything), and your desired checkout flow for a new customer, a returning but not logged in customer, and a logged in customer. That'll help us work through things with you.
  • Thanks Brett
    Here is the site so far:
    The site is pretty much functional, it uses the Login plugin for Modx. When the user goes to checkout I want them to be required to login or already be logged in. For new customers I want them to be redirected to the registration page.

    I'm just not sure where to start with the integration.
    Thanks in advance for the help!
  • Hello again, its been 5 days since there has been any activity and I could still use some help on this. Would be appreciated.

  • brettbrett FoxyCart Team
    Sorry for the delay. I was communicating with a MODX dev about some code he's building that might help, but it's not ready yet (and isn't a perfect match for this).

    So, first off:
    When the user goes to checkout I want them to be required to login or already be logged in. For new customers I want them to be redirected to the registration page.
    We generally recommend allowing a checkout as a guest (or if not enabling guest mode, at least allowing checkout through the FoxyCart-powered checkout page without first registering elsewhere). That allows for the most streamlined approach, and puts the least number of hurdles between your customer and a successful transaction.

    Once the order's done, you can create the user in MODX, so the end result is still a synchronized user.

    In any case, there are three main pieces to dig into:
    1: Creating and updating users from MODX -> FoxyCart
    2: Creating and updating users from FoxyCart -> MODX
    3: The SSO endpoint (MODX->FC->MODX)

    #1 would be a plugin in MODX that attaches to specific events. I'm not very familiar with Revo yet, but I'd probably do a single plugin that responded to all necessary events (OnUserChangePassword, OnUserSave). On those events, just do a quick FoxyCart API call to create/update the user as needed.

    #2 would process the instant XML datafeed, so I'd point that to a page in MODX that had a snippet that decrypted the XML and created or updated the user as needed.

    #3 would be another snippet. There's some sample code that should make that pretty easy once the first two pieces are set up.

    Does that give you enough to get started with? Or at least to continue the discussion?
  • Brett,
    Thanks! I will take a more in-depth look at your post later since im about to board an airplane. It looks like you have given me enough to start with. I will look at this when I am able and start tinkering.

    Thank you,
    I will post with my questions or success when I can.
  • Hey Guys,

    I'm looking into a very similar setup, with a membership purchase via foxycart that also creates a user account in modx (same email/password as used in foxycart checkout).

    @tsnekifox, how did this go for you? Any tips / code that you would be willing to share?

    Let me know!
  • brettbrett FoxyCart Team
    @nickff, there's been a lot of talk about this lately from a few different people. You looking for Revo or Evo?
  • @brett, I'm thinking Revo. With 2.2 and the new Articles plug-in, it's seeming like the time has come for us to use Revo for just about everything.
  • brettbrett FoxyCart Team
    I've pinged the MODX guys about a related issue on our forum here:

    If you could be so kind, ping this thread if we don't update it in the next 4 or 5 days.
Sign In or Register to comment.