Customizing SMF > Portals, Bridges, and Integrations

Magento E-commerce - SMF forums bridge files and code

<< < (10/10)

Andre N:
Yeah, The SmfSsi module is just for displaying SMF data inside Magento, like if you want to show who's online in a block or stats or a calendar or whatever.
I did start working on a real bridge; here's what I have so far. Unfortunately I haven't had time to work on this for so long. Feel free to finish it and claim it as your own :)
It's been a while since I've even looked at this code, and it's definitely unfinished...
There were some major sticking points that I didn't resolve such as:
- When a user changes their email address in Magento, there is no way to get their old email address, so there is really no way to know when an account is updated if the email was changed. If it was you're screwed because that is the only commonality between SMF and Magento account-wise. I tried to overcome that by adding an attribute with the SMF member id in Magento and had some success, but I just didn't finish writing the code.
- I couldn't figure out a way for the 2 to share a session, because there are so many ways for Magento to store it's session, db/files/cookie and SMF uses just the cookie, so I was making one close it's session, open the other, close it. restore the old one... for lack of a better method. Probably just my inexperience
- There are multiple ways for accounts to be edited and created in Magento and they are drastically different, yet they still trigger the same event observer. If you create your account at checkout, or create it by registering, or an admin creates it expect different params to reach your observer.
- Every version of Magento gets better, but things change which makes it hard to do simple stuff that will work in 1.5x and 1.6x. For example see my extension Red2Black_HidePrices. It will install perfectly in 1.5x yet in 1.6x it won't create the attributes it needs to function. I would rather make a version that works for the latest versions than make 40 different versions that each work with a specific version. I'd prefer to make it foolproof and easy to use and automatic in every way for every possible user configuration but there's so many possible ways for things to get screwed up it's insane.

So, here's the files I have, you can do whatever you want with them. What I would recommend you do is either:
A. Install Joomla (even if you won't use it) and use the JFusion plugin which will integrate the Joomla, SMF and Magento for you. Not sure what versions of what will be supported but if you are still developing you can use the ones that are.
B. Disable login/logout/registration from Magento and handle it all through SMF using the integration hooks file that's here inside the bridge code. Just include the file in your SMF index.php (the root one) and let it control Magento for you. It is unfinished but it shouldn't be too hard to complete. The functions that are written all work I believe. Disable login/logout/register in Magento by using the observers to redirect those requests to the proper url
C. Disable login/logout/register in SMF and let Magento handle it all. Also disable account edit in Magento so they can't change their email. This might be easiest besides the JFusion route.
D. Try to finish the module :)

If you need any help with any of this, post and I'll help you out as much as I can.

Navigation

[0] Message Index

[*] Previous page

Go to full version