Bridge SMF and Magento eCommerce

Started by SlammedDime, March 13, 2009, 08:01:37 PM

Previous topic - Next topic

SlammedDime

A bridge to Magento is currently in the works.  Actually it's about 75% complete, just need to finish admin login stuff and bug testing.  What I'd like to layout is what I've done, and get any feedback before I even think about doing a beta test (I need to wait to here from Magento as well on licensing questions too).

Here's what I have so far:
  • A configuration interface to enable/disable bridging and setting some options needed, like the Path to SMF
  • If  user is already logged into SMF, and clicks the 'Log in' link in Magento or visit a link in Magento that would normally require them to login, they will automatically be logged into Magento, without it requiring any input from them.
  • If a user is not logged into SMF and clicks the 'Log in' link in Magento or visit a link in Magento that would normally require them to login, they will be redirected to SMF to login, and then redirected back to Magento after a successful login.
  • If a user is logged into Magento, then they must be logged into SMF, so if they try to log out of Magento, they will automatically be logged out of SMF as well, then redirected back to Magento
  • If a user already has an existing account on your Magento site that uses the same email as your forum, they will retain all of their account information and history after bridging.  If they use a different email address, they should change their email in SMF to match and then they're accounts will be synced.
  • If a user logs out of SMF, they will still stay logged into Magento. be logged out of Magento (this is inherited by the Magento logout, because of the integration hooks)
  • If a user logs into SMF directly, they will not be logged into Magento until clicking the 'Log in' link or visiting a page that requires login. (both this, and the last bullet, would require code changes to SMF, and in the spirit of bridges released by SMF, a bridge should not make any code changes to core files of either application.  None of what is above these two items has required any core code changes to SMF or Magento.)

    To be implemented:
  • Admin logins will be controlled in the fact that you must be an administrator on SMF (be in group 1, either primary, or secondary) and will use the same principles above.
  • In some way track email address changes, as Magento uses email addresses to authenticate login, not usernames.  As it stands now, if someone changes their email address in SMF, Magento would end up creating a new user account for them on it's end upon [first] login.  The way around this would be to require users to change their email address in Magento, and flow that change to SMF automatically.  But there currently are no permissions or mechanisms in SMF to disallow the editing of email addresses.

    This is not an integration.  The main thing that this will not do is integrate user info from Magento into SMF, such as order history, address information, etc, etc.  I will most likely be creating a mod for that to complement this bridge once it's released.

    So what are peoples thoughts?  (oh, and for those that have never used Magento, I recommend taking a look at it.  I like it much better than osCommerce)
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Orstio

QuoteIf a user logs out of SMF, they will still stay logged into Magento.

If a user logs into SMF directly, they will not be logged into Magento until clicking the 'Log in' link or visiting a page that requires login. (both this, and the last bullet, would require code changes to SMF, and in the spirit of bridges released by SMF, a bridge should not make any code changes to core files of either application.  None of what is above these two items has required any core code changes to SMF or Magento.)

These can both be accomplished without code changes to SMF.

One small database change in the settings table:

variable=>value
integrate_pre_include => file.php

That will cause SMF to include the file "file.php" as soon as SMF starts loading settings.  In that file you can define the other integration hooks and functions for them.


SlammedDime

#2
Ahh, the one hook that I didn't think about.  Thanks for that, it won't be hard now to do those two bullets or the email issue.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

fords8

Magento is very nice. Any closer to it coming out? Or is it out? I have not looked at it in a while.

SlammedDime, nice work! I will keep a eye on this topic.

SlammedDime

Ok, after a lot of rewriting after rewriting, I have something stable for a front end bridge.  I still need to do the authentication for admins, and also for profile changes (email addresses).  It's looking quite promising.  The biggest thing that it boils down to is licensing, and I'm still waiting to hear back from Magento on that.  Their support is less than desirable.

SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Orstio

Execellent.  :)

While I am not a lawyer, reading their license ( http://opensource.org/licenses/osl-3.0.php ), it seems to have a good definition of "derivative works", and I think you can safely distribute a bridge under whatever license you want:

Quoteb) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;

From the people who wrote that license:  http://www.rosenlaw.com/OSL3.0-explained.pdf

QuoteThe definition of Derivative Works in § 1(b) is particularly important. For one thing, that
defined term includes no reference whatsoever to linking or to any other technical manner of
making programs interoperate. The verbs used in § 1(b) ["translate, adapt, alter, transform, modify,
or arrange"] reflect the kinds of activities that we generally do to create derivative literary or other
expressive works, and those things—not functional linking—create Derivative Works as defined in
this license. As a result, linking an unchanged Original Work with another independently-written work does not, absent more, create a Derivative Work subject to § 1(b); such an act is merely the
incorporation of a copy of that Original Work into a collective work, authorized by § 1(a).

SlammedDime

that's what I was thinking Orstio, and also what I was banking on.  The only thing that concerned me is that there was some stuff on their board saying that you either needed a commercial license to sell extensions under your own license, or they had to be released through MagentoConnect as OSL, but nothing solid from anyone from Varian or Magento.

As it stands, I am not distributing any of their files and make no changes to their code, only the files that I have written that extend and overload classes and functions, and only the functions that I am overloading, that I have rewritten, are in my files.  I do make calls to Magento code, but I believe that would fall under the 'linking' term, just as I 'link' to Magento with the integration file that SMF uses.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Orstio

I believe you are correct.

QuoteThe only thing that concerned me is that there was some stuff on their board saying that you either needed a commercial license to sell extensions under your own license, or they had to be released through MagentoConnect as OSL, but nothing solid from anyone from Varian or Magento.

I think they are referring to selling extensions.  There can't possibly be any restriction on the location from where you release your extension, but I can see there being a restriction on commercial use of Magento.

fords8

I read some of the stuff on the Magento site. Sounds like if you change the Magento core at all, you will have issues. If you are calling any Magento code, I think that is fine. Since you are not changing Magento code at all.

So you are setting this up so you have to install SMF and Magento like you would any other time. Then your bridge would be installed from the package manager within SMF?

Of course getting them to agree in writing is best. This way they can't question you down the road.

SlammedDime

The only thing that SMF requires is a 'helper file' that contains the integration functions, and this just needs to be placed in the SMF directory.  I don't think I will do a Package for that for the Package Manager.  Everything else gets installed into Magento, and Magento will fill the appropriate modSettings variables the first time the bridge is enabled.

SMF and Magento do not have to use the same database, they only have to reside on the same domain/subdomain.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

fords8

Quote from: SlammedDime on March 23, 2009, 06:13:04 AM
The only thing that SMF requires is a 'helper file' that contains the integration functions, and this just needs to be placed in the SMF directory.  I don't think I will do a Package for that for the Package Manager.  Everything else gets installed into Magento, and Magento will fill the appropriate modSettings variables the first time the bridge is enabled.

SMF and Magento do not have to use the same database, they only have to reside on the same domain/subdomain.
Sounds like a plan to me. I look forward to testing this out when you are done with it.

brelwit


SlammedDime

It's pretty much complete, however right now I and the team are concentrated on completing SMF's new theme, so once that is complete, I'll be doing further bug testing on this and possibly release a beta.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

brelwit

Ok good to hear that.  I am wondering, if your bridge will be compatible with SMF 1.1.2?

SlammedDime

I have to discuss with the Dev's if I should do a version for SMF 1.1.x (but I could only promise it would work with 1.1.8, and if you're not running 1.1.8, I can't recommend strongly enough that you do, as there have been numerous security fixes).
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

brelwit

I have long been searching for any SMF bridge with an open source shopping cart system but until now couldn't find any.  So I am anticipating the release of your work. 

I think I may just need to start upgrading my forum to 1.1.8.  That would be a long task if I am starting from 1.1.2 considering that I have so many customized codes and a bridge to Coppermine as well.  Aaarrggh...  >:(

Trekkie101

Quote from: brelwit on April 20, 2009, 06:24:50 AM
I have long been searching for any SMF bridge with an open source shopping cart system but until now couldn't find any.  So I am anticipating the release of your work. 

I think I may just need to start upgrading my forum to 1.1.8.  That would be a long task if I am starting from 1.1.2 considering that I have so many customized codes and a bridge to Coppermine as well.  Aaarrggh...  >:(

Have a look at http://custom.simplemachines.org/upgrades/ this may be able to help :)

brelwit

Quote from: Trekkie101 on April 21, 2009, 05:55:45 AM
Have a look at http://custom.simplemachines.org/upgrades/ this may be able to help :)

You are a saviour! Thanks! :D  I pray all add-ons I've made will still work after these upgrades.  I guess it's time to get my hands dirty again.

eitai2001

Hi. Any news on the stable release yet?

SlammedDime

Not quite... I've been spending some time on working on the new SMF theme, so this has taken a back seat... what I have *is* fairly stable I think, but I do need to do some more bug testing... I've found one bug that really bothers me that I have to work on fixing that this can't be released without fixing.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Advertisement: