ExpressionEngine Extension: Push to FoxyCart Mar 04. 10
While working on a project recently with the FoxEE E-commerce module for ExpressionEngine we discovered that it doesn’t integrate at all well with the Solspace User Module. This is understandable because the Solspace User Module circumvents the standard process for user registration and profile updates in ExpressionEngine. The upshot of this is that you simply ‘cannot’ make single sign on with FoxyCart work with FoxEE if your users are registering or updating their profile using the Solspace User Module. Now this is a bit of a problem since pretty much any E-commerce site built on ExpressionEngine will be using the Solspace User Module to allow users to easily manage their account details etc.
After much hacking and messing about I suggested to Ed who was working with us at Nine Four at the time that we could perhaps build an extension that used the User Module Hooks and the FoxyCart API to do the job. Ed went away and came back a very short time thereafter with a working solution. We like to call this little extension ‘Push to FoxyCart’ and we’d love to share it with anyone else that’s come up against the same problem that we did.
To clarify, you only need this extension if you are using the Solspace User Module, FoxEE and FoxyCart and you want to enable SSO for your ExpressionEngine site members. The extension is very simply but it requires some basic configuration.
Download: ext.push_to_foxycart.php.zip
At line 13 you will have to enter your ‘FoxyCart Domain’ (mysite.foxycart.com for example) and at line 14 your FoxyCart API token. Finally you’ll need to change the mapping of the FoxyCart fields to the ExpressionEngine custom member profile fields on lines 100 through to 119. This should be pretty obvious… if not then perhaps you already bit off more than you can chew! :)
Make sure you’re running PHP5 and have access to CURL on your server, upload the extension, enable it and you should be good to go. For support I’ve created a topic on the ExpressionEngine forums, hopefully if I’m not able to help with any problems you encounter then someone else might be able to chime in. :)
Migrating from TXP to EE - Conclusion Mar 29. 094
Ok, so steps 1 through 5 pretty much got us to a conclusion but there was one little fact that really had me bugged about the migration. I wanted to persist the article IDs from Textpattern during the migration to ExpressionEngine because they are used in my permalink URLs. Basically I don’t want to break the internet (or my small part of it) by altering the URL structure in the switch. How did I do it?
Open ‘cp.mt_import.php’ form within ‘/system/cp/’ then at line 954 add:
$ids = array();
then at about line 1028 add:
// IDs Hack
if (strpos($parts['0'],'ID') !== false)
{
$ids[$id] = trim(str_replace('ID:','',$first_section[$i]));
}
At about line number 1765 amend the entry id value to:
'entry_id' => $ids[$id],
Now save and upload your amended import script. Back in Textpattern you’ll also need to add one new line to the top of your export script.
ID: <txp:article_id />
So your Textpattern export will now include the original article ID and the import process will maintain this (so long as you have deleted all other weblog entries prior to import).
So, that’s it. I’m all done… I migrated… now I just have to find the time to finish off the new design and implement it! Happy Migrating!!!
ExpressionEngine Field Frame Field Type: UK Counties Select Mar 23. 092
Having had a play with the wonderful ExpressionEngine Field Frame extension which Brandon Kelly has authored I felt inclined to port my UK Counties Select Plug-in. Once I can get my head round the reasons for GitHub not working as expected I’ll post it there, in the mean time:
Download: np.uk_counties_select.ff_fieldtype.zip
You might also want to check out the numerous other field frame field types that Brandon is assembling.
ExpressionEngine Plug-in: US States Select Jan 15. 093
This is just a variation of my UK Counties Select plug-in for ExpressionEngine which as you might expect, returns a list of US states in the drop down rather than UK counties. Usage of the plug-in is as follows:
{exp:np_us_states_select name="states"}
There are also some additional parameters you can pass that are detailed in the plug-in info page.
Download: pi.np_us_states_select.php.zip
Obviously let me know in the comments if you have any thoughts on how this can be improved. Enjoy!
ExpressionEngine Plug-in: Add VAT Jan 08. 094
I’ve just written a new ExpressionEngine plug-in called ‘Add VAT‘. This plug-in takes any numeric value and returns the value plus VAT. You also have to specify the VAT rate obviously.
Typical usage is as follows:
{exp:np_add_vat price="120" rate="15"}
I’m using the plug-in on a website I’m developing where I need to be able to display prices inclusive and exclusive of VAT. Currently the Simple Commerce module does not provide a facility to specify VAT or taxes.
Download: pi.np_add_vat.php.zip
If you have any further ideas as to how the plug-in could be developed do let me know. :)