Wordgento

I seem to spend half my life integrating Magento elements into WordPress; this is why I created Wordgento! It allows you to quickly add any of the default Magento Blocks into your WordPress theme – for example, the shopping cart, top links, top navigation, and more.

Download Wordgento

Installation

First of all, you will need to deactivate a function in Magento that conflicts with one in WordPress.

  1. Navigate to ~/your-magento/app/code/core/Mage/Core/functions.php
  2. Copy the functions.php file and paste it at ~/your-magento/app/code/local/Mage/Core/functions.php. Magento will now default to use this functions.php, over the one in the core folder.
  3. At around line 90, you will find this bit of code:
    function __()
    {
        return Mage::app()->getTranslator()->translate(func_get_args());
    }
  4. You will need to replace it with this:
    if(!function_exists('__')) {
            function __()
            {
                    return Mage::app()->getTranslator()->translate(func_get_args());
            }
    }
  5. Save the file, and upload!

Once you have done the above, you are ready to install the plugin. If you have installed the plugin via your WordPress admin panel, skip to step 3.

  1. Download the plugin and extract the files.
  2. Upload wordgento to your ~/wp-content/plugins/ directory.
  3. Activate the plugin through the ‘Plugins’ menu in WordPress.
  4. Go to the Wordgento settings page (New item in your main admin menu).
  5. Enter the path to your Magento installation from the root.
  6. Enter the Magento theme that you are using.
  7. Enter the website code if you have more than one store active.
  8. Save your settings, and follow the usage instructions.

Usage

At the moment there are 13 different blocks you can get from Magento. The codes to use are as follows:

        // CSS/JS - (This is usually in the head.phtml file of your Magento theme.)
    <?php echo wordgento('cssjs'); ?>
        // Includes - (This is usually in the head.phtml file of your Magento theme.)
    <?php echo wordgento('inc'); ?>
        // Welcome Message - (This is usually in the header.phtml file of your Magento theme.)
    <?php echo wordgento('welcome'); ?>
        // Logo - (This is usually in the header.phtml file of your Magento theme.)
    <?php echo wordgento('logo'); ?>
        // URL - (This is usually in the header.phtml file of your Magento theme, around the logo.)
    <?php echo wordgento('url'); ?>
        // Top Links - (This is usually in the header.phtml file of your Magento theme.)
    <?php echo wordgento('toplinks'); ?>
        // Search - (This is usually in topBar.)
    <?php echo wordgento('search'); ?>
        // Top Menu - (This is the main menu, requires the css/js to be loaded for dropdowns.)
    <?php echo wordgento('topmenu'); ?>
        // Wishlist - (This is usually in the left sidebar.)
    <?php echo wordgento('wishlist'); ?>
        // Recently Viewed - (This is usually in the left sidebar.)
    <?php echo wordgento('recently_viewed'); ?>
        // Compare - (This is usually in the left sidebar.)
    <?php echo wordgento('compare'); ?>
        // Sidebar Cart - (This is usually in the left sidebar.)
    <?php echo wordgento('sidecart'); ?>
        // Newsletter - (This is usually in the footer.)
    <?php echo wordgento('newsletter'); ?>

Things to Remember

  1. Make sure you set the cookie paths in Magento – If your Magento installation is in a sub folder, go to your Magento admin. Navigate to System -> Configuration -> Web -> Session Cookie Management. Set the Cookie Path to / and set the Cookie Domain to .yourdomain.com.
  2. Make sure you disable the __() function in Magento

Known Issues

  1. Wordgento does not like the WordPress Tumblrize plugin!
  2. Wordgento does not like the cForms plugin!
  3. It is best not to use WordPress caching plugins, as they may also cache the current Magento customer session.

What’s Next?

In the next release of Wordgento, I want to:

  1. Add the ability to name your own blocks. For example, if you have created your own topcart.phtml block in Magento – you will be able to add it in Wordgento and call it out.
  2. Get some more WordPress/Magento developers on board to make this plugin the best.

Download Wordgento

95 Responses to Wordgento

  1. Jay Pick says:

    09:21 12/05/2011

    Great plugin JK!

  2. Nicola Connolly says:

    09:29 12/05/2011

    Nice one :) I look forward to using it!

  3. Tristar Author

    Genius title as well.

  4. devopensource says:

    18:54 19/05/2011

    Loock great! thx :)

  5. Jeremy says:

    18:35 20/05/2011

    Very cool. Where can I find an example of this implemented?

  6. I’ve used it on a couple of sites now – Cheer Up Clothing and Nicole Gill Lingerie, to name but a few.

    I’d love to see it used elsewhere, so if anyone is reading this – let me see!

    The new version is underway as well, which will allow you to add blocks that you’ve created in Magento, and Wordgento will generate the code snippet for you to use it.

  7. Mark @ Blazen Web Marketing says:

    14:44 23/05/2011

    Great extension James. If a customer with a Magento customer account wanted to comment on a blog post in Wordgento, would they have to create a new account? Or could they use the existing account?

  8. As it stands, they’d have to create another account – although I guess it depends what settings you have, on most blogs you don’t need accounts to post comments.

    It’s definitely something I am looking into for future releases though. Glad you like it!

  9. Mark @ Blazen Web Marketing says:

    15:41 23/05/2011

    Good point about not needing accounts to post blog comments! A bit of a dim comment!! I guess the ease of having accounts that span both systems is more important for backend users.

  10. Marcelo says:

    20:03 24/05/2011

    Is Wordgento ready for localization?

  11. Hi Marcelo – I’m not 100% sure what you mean?

  12. Marcelo says:

    09:40 27/05/2011

    Hi James.
    I downloaded the plugin and checked that there is no .pot file for translation. Do you plan to include this feature in a future release? If so, I can translate it into Brazilian Portuguese. It is certain that others would translate the plugin into other languages.

  13. Hi Marcelo, I haven’t got any plans to do a translation as of yet – but I will keep you in mind for future! Thanks.

  14. Timothy says:

    17:44 27/05/2011

    hey, I got a question do wordpress and magento have to be installed on the same database? please email me back at hello[at]timdueck.com

  15. seeal says:

    22:51 29/05/2011

    estoy utilizzado un prefijo para los ficheros phtml como “sidebar_wordgento.phtml” para poder modificar la salida que muestra el plugin de wordpress a los que tiene la plantilla que utilizo en magento.

  16. Hi Seeal, I tried to translate this message, but the translation didn’t make sense – I’m not sure what you’re asking!

  17. Jeff M says:

    08:32 01/06/2011

    I’ve tried to set this up, I see “You have no items in your shopping cart.” no matter what from the embed I put in my theme. Not sure what I can do, I’ve tried just about everything, switching to file sessions, restarting apache, clearing caches.. you know what this could be?

  18. After taking a look it seems the cforms plugin was interfering, I have added this to the list of known issues, and I’ll take a look at it for the next release.

  19. jim mccann says:

    08:38 06/06/2011

    Hi James,

    I’ve been spendingthe last month tying to find a suitable ecommerce pligin for WP.

    From what I can see, using your plugin with Magento seem sto be perfect.

    Apart from the two sites: Cheer Up Clothing and Nicole Gill Lingerie, do you have any more urls I can have a look at?

    Regards,

    JIm McCann

  20. Anthony says:

    09:51 06/06/2011

    When I have my blog in blog.domainname.com and my magento install is domain.com will it work as well?

  21. Hi Anthony, I’m not 100% sure about that actually, it may work… Give it a try and let me know how you get on!

  22. Rick says:

    22:07 06/06/2011

    This looks like an awesome plugin James! I looked at the two example websites you provided but I’m not quite sure I understand how you integrated the design. Are you just using a WordPress theme and pulling the Magento product catalog, shopping cart etc into the wordpress theme? Or did you have to design two themes that look exactly alike, one for WordPress and one for Magento. I already have a website that I’ve designed in WordPress, what I would like to do is pull the Magento product catalog, shopping cart etc into my already existing WordPress theme. Will this plugin let me do that?

    Thank you…

  23. Ross Higgins says:

    23:38 06/06/2011

    When I had issues integrating Wordgento, James was quick to respond and super helpful. He was able to find the problem and propose a solution very quickly. Nice work James, and thanks again for the superior customer service!

  24. arian says:

    04:33 07/06/2011

    Hi James
    i am testing wordgento in wordpress 3.1.3 and when i use in page.php
    the result is like
    {{{My Account}}{{My Account}}{{My Account}}{{Mage_Page}}}
    {{{My Wishlist}}{{My Wishlist}}{{My Wishlist}}{{Mage_Page}}}
    {{{My Cart}}{{My Cart}}{{My Cart}}{{Mage_Checkout}}}
    {{{Checkout}}{{Checkout}}{{Checkout}}{{Mage_Checkout}}}
    {{{Log In}}{{Log In}}{{Log In}}{{Mage_Page}}}
    do you know what’s the problem?

  25. @Rick – This plugin requires 2 themes, one for Magento and one for WordPress. The good thing about the plugin is it allows you to have your themes look exactly the same. You can use Wordgento to brin in the cart, top nav, top links, and basically any block available in Magento – as well as the sessions (core/customer). It should do what you need!

    @Ross – Thanks, glad it’s all sorted for you!

    @arian – Hi Arian, send me a message via the contact form on the site and I will try and give you a hand. It should be fine in 3.1.3

  26. Abdul Jamal says:

    13:45 13/06/2011

    gr8 plugin for wordpress

    thanks for this

    http://www.facebook.com/MoGaMboOo

  27. JohanRoel says:

    02:58 16/06/2011

    Will be testing tomorrow. You’re looking for some developpers…? I might be willing to help. Could you contact me please?

  28. James Scott says:

    10:32 21/06/2011

    This is immense! Really top notch plugin with an incredible amount of thought and care taken towards the production and instructions for users to follow. I hugely recommend this to everyone who wishes to combine these two powerful platforms.

    Thanks again!

  29. James Nguyen says:

    03:33 24/06/2011

    Hi,
    I installed wordgento as instructed and I change mageto path in wordgento path ( my wordpress admin) to “/” ( I install magento in root), it my wordpress is down. When I disable wordgento, my wordpress is working normally.
    I use Magento v1.5.0.1 and WordPress 3.1.3.
    What problem?

  30. Hi James, Did you make sure to disable the __() function in Magento, it seems as though that may not have been done, or is not working properly.

  31. James Nguyen says:

    09:14 24/06/2011

    Hi,
    Disable the __() function? How to disable? Please intructions for me.
    Thanks

  32. Steps 1-5 in the instructions above!

  33. James Nguyen says:

    09:31 24/06/2011

    Oh, thanks.
    I had do step 4-5, but i do wrong.

    Thanks.

  34. James Nguyen says:

    09:47 24/06/2011

    Hi James,
    I have do step 1-5 and other step but my wordpress page is down. What problem?
    I had disable __() functions.

  35. James Nguyen says:

    09:50 24/06/2011

    It works. I’m not change “Magento Store Code” from “default” to “”.
    Thanks.

  36. Glad you got it working!

  37. James Nguyen says:

    09:56 24/06/2011

    Hi,
    I have other questions.
    I use magento themes in path ( ex: mcomputer/default), i will fill “Magento Theme Name:” like?
    “mcomputer” or “default” or “mcomputer/default”
    I have filled out as above but it still does not display properly.

    Please visit: http://www.mtag.vn ( magento site) and http://www.mtag.vn/news ( wordpress page) see more.

  38. Hmm, I’ve not seen theme paths like that before – if you send an email via the contact form with magento and wordpress logins I can a look for you.

    Thanks.

  39. James Nguyen says:

    10:11 24/06/2011

    Hi,
    I just send for you magento and wordpress info.
    Please check your email:

    Thanks.

  40. lolo says:

    16:32 28/06/2011

    a great job, I have only one question: does the payment method is the one with magento (eg credit card)?

  41. lucas says:

    09:53 29/06/2011

    hi, how i use the block codes at wordpress? is in a post that i write ,for example? i cant see anything….

  42. James Nguyen says:

    09:56 29/06/2011

    Hi,
    I want to call file header.phtml. How do i do?

  43. Eric S. says:

    19:32 30/06/2011

    How do you configure Wordgento if both the WordPress and Magento installs are on different domains? I keep getting an error that says “The path you entered to your magento installation folder was incorrect!”

    For example

    WordPress install is at: http://XXXXXX.com
    Magento install is at: http://YYYYYY.com

  44. The simple answer is – you can’t! Wordgento requires you to include Mage.php (this is why the magento path is required). PHP includes can only occur on the same domain.

  45. Eric S. says:

    20:31 30/06/2011

    Thanks for the reply. Will work on getting both WP and Magento on the same domain.

  46. Tyler says:

    19:08 06/07/2011

    I installed everything as above and now all my wordpress pages are returning 404 errors. I have my permalinks set to /%postname%/ .. Need some help with this. Thanks

  47. Allan Nygren says:

    19:45 06/07/2011

    Hey James,
    Excellent plug-in and very timely for me. Quick question though: I have a custom theme package that I’m using that isn’t in the default themes directory it lives in its own package like app/design/frontend/themepackage. Then under that package it has a theme name so themepackage/themename. No matter what I put in the ‘Magento Theme Name’, it won’t pull down the associated CS and Javascript with the theme package. I’ve tried themename, themepackage, and themepackage/themename.

    If I change my store back to the default modern theme, wordgento will pull the correct CSS.

    Any thoughts would be greatly appreciated!

    Thanks.

    Allan

  48. Hi Tyler, if you send me your blog details, wordpress logins and possibly FTP I can take a look for you. Use the contact form on the site.

  49. Hi Allan, someone else actually came across this problem the other day. I think I recommended, that they move the theme from inside frontend/themename into frontend/default and see if that works. I will look at getting this issue sorted in the next release.

  50. Allan Nygren says:

    13:33 07/07/2011

    Hey James,
    Thanks for the response! I’ll give that a shot. Is there anywhere that we can donate to the cause?

    Allan

  51. There is! Donations are greatly appreciated, and can be made via this link – https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ARGY32BH344K2

    Thanks Allan, hope you get it working

  52. Allan Nygren says:

    14:05 07/07/2011

    So, that’s working to an extent. When I moved it over to the frontend/default folder, it started pulling from the default CSS file of magento. I figured out that the custom theme I was using wasn’t using a styles.css, but instead had broken them out into a bunch of smaller css files like base.css, base.min.css, etc.

    Just for the heck of it I threw in a styles.css into the theme folder and lo and behold Wordgento read that one, but it’s not pulling in any of the other stylesheets for this theme.

    I checked the page.xml to make sure that these stylesheets were being called in the cssjs portion and they are, any thoughts?

    Allan

  53. Tyler says:

    23:44 07/07/2011

    Having problems with pulling the sidecart into wordpress with the php block. Shows nothing in cart regardless of anything new being added to the cart.

  54. Hi Tyler,

    There’s a few things that could cause this. First of all, what other plugins have you got installed? And secondly, did you set up the cookie paths as mentioned above?

  55. Tyler says:

    20:18 08/07/2011

    So for cookie path you type in “/” and for domain you type “.yourdommain.com” with the period?
    I got these plugins active: custom sidebars, facebook comments, facebook like, google analytics for wordpress, google xml sitemaps, plugin central, premium slider, recent posts slider, search & replace, thembnail slider plugin, vertical scroll recent post.

  56. Rich says:

    21:01 11/07/2011

    This plugin is wonderful, I can’t wait to integrate these two applications!

    Question – Which php call did you use for the shopping cart reference in the header on http://www.cheerupclothing.com/blog/

  57. Hi Rich,

    I actually wrote that in myself as it is a custom block, however, the second version of Wordgento I am working on allows you to use custom blocks.

    The one on cheerup is a new block called topcart.phtml

  58. johnny says:

    15:41 12/07/2011

    That seems like THE PLUGIN of the year.
    Can you give us an idea of when you will be releasing the next version?
    thx

  59. Hey Johnny, it’s actually ready now, but I want to do some serious bug testing with it, as there is a lot that could potentially break!

  60. Ben says:

    16:33 13/07/2011

    I just have a blank page :(

  61. Did you follow the instructions? You need to remove the __() from Magento.

  62. Sven Raphael Schneider says:

    21:36 15/07/2011

    This looks certainly like a nice plugin! Currently, I run wordpress with w3 Total Cache. I want to add an Magento so your plugin comes in very handy. I looked at your demo site and I really like the implementation.
    However, I also like w3 total cache and I do not want to turn it off.
    Sorry for asking this question but I just got started on Magento: But what does it mean if the “current Magento customer session” is cached? Will anybody be able to see what the one person had in their cart or what are the consequences?

    What Magento Themes can you recommend? I think I like it clean and simple for the shop.

    Thanks so much in advance!

  63. As it stands, the w3 total cache would cache the first users session, meaning that if he added an item to his cart, everyone else would see the same item in there carts.

    I’ll have a look to see if I can exclude the sessions from the cache plugins, which may help.

  64. Sven Raphael Schneider says:

    17:56 19/07/2011

    Thanks for your answer James. It sounds like you should get in touch with Frederick Townes, the coder of W 3 Total Cache . He is a nice guy that is very helpful and quick to answer his emails.
    That way, you should be able to make things work.
    w3 total cache is so good, that no real wp blog should run without it and it would certainly be sad if your plugin would not be applicable because of it.
    Feel free to send me an email if you have more questions.

  65. Adeel Ishfaq says:

    03:30 20/07/2011

    Great plugin :-)

  66. Hi Sven,

    I just tried installing w3 total cache and it seemed to work OK. Give it a try and see if everything runs OK.

    James

  67. MG says:

    08:38 20/07/2011

    Hi James,

    Very nice work here, exactly what I’m looking for and your demo sites look and function great with the integration. You say you require a template for magento and one for wordpress, will you be providing a default template for both magento and wordpress with all the wordgento functions in? This will certainly provide a base for us to develop from.

    Thanks

  68. Hi MG,

    As it stands I have no plans to release a theme for WordPress of Magento, the idea with Wordgento is that it makes it easy for you to integrate the two platforms, without being restricted in any way.

    If you need some assistance integrating it, just let me know!

    James

  69. marc says:

    18:41 21/07/2011

    Hi James,

    Thanks for a great plug-in.

    It seems that the ‘checkout’ button doesn’t work for me in the sidebar cart.

    Marc

  70. Hi marc,

    What does the checkout button do?

    Thanks,
    James

  71. Leland says:

    23:55 26/07/2011

    My wordpress stopped working when I activated your plugin. I made sure to disable the __ function. I ended up having to comment out “$block_topmenu = $Block->createBlock(‘catalog/navigation’)->setTemplate(“catalog/navigation/top.phtml”)->toHtml();” in your plugin

    Any idea why that line would be failing?

  72. Adeel Ishfaq says:

    14:56 27/07/2011

    Need More functionality in this plugin , i m read to work with you to get more functionality.

  73. Eric S. says:

    22:53 27/07/2011

    I’ve confirmed that the checkout button in the side cart doesn’t work when being displayed in WP 3.2.1 and Magento 1.4

    I’ve tried on the Twenty Ten, Twenty Eleven themes. Clicking on it has no response.

  74. marc says:

    07:21 28/07/2011

    Hi James,

    Sorry for slow response – I’ve been away from the net for a few days. As Eric S. has pointed out, the checkout button in the sidecart does nothing when clicked. I’m using WP3.2.1 with the TwentyEleven theme.

  75. Hi Guys,

    In order for the checkout button to work, you need to have loaded in the cssjs as well. For some reason Magento uses a javascript function to tell the button where it should link to.

    In the new version of Wordgento to be released soon, you will be able to choose what js and css loads in, so there wont be unnecessary scripts loaded.

  76. Stacey says:

    11:45 04/08/2011

    Hi, Awesome plugin!

    When will the second version be available for adding custom blocks?

    Thank you.

  77. Kathrin says:

    21:17 04/08/2011

    Is it possible to link multiple wordpress installs to the same magento cart? For example, 3 subdomains, each with their own blog, but the same exact store?

  78. I guess that’d be possible… as long as the subdomains all reside in the same account, under subfolders. Let me know how you get on

  79. Eddie says:

    13:51 09/08/2011

    James, I’m trying to figure out if your solution is the best one in my case. I want to be able to use any WP plugin and upgrade WP as needed. I also want to be able to upgrade Magento normally. The only thing I need is for the user to not lose the session when moving between magento and wordpress. I dont even really need to have WP use magento’s theme (I will create a WP theme that is similar enough).

    Based on what I read, I take that this plugin IS what I need… Would you please confirm that, based on what my needs are?

    TIA

  80. Hi Eddie, yep! It seems like Wordgento will do what you need.

    James

  81. jeannie says:

    22:06 12/08/2011

    hello
    thank you for wonderful plugin

    just wondering

    i need to call add-to-cart is it possible??

  82. Dandy says:

    13:17 15/08/2011

    Great plugin for mixing these up together, although I’m experiencing some strange behavior once the customer is logged in. My cart becomes empty and welcome message still says – Welcome Guest.
    Maybe You could provide some advice, I am pretty stuck :/

  83. Paul says:

    23:40 18/08/2011

    Hi! Thanks a lot for the plugin.
    I followed all your instructions, but don’t really know how to setup the Magento cookies.
    My structure is : http://localhost/wordpress and http://localhost/wordpress/magento. I tried to change the Cookies Path to /wordpress/ and Cookie Domain to .http://localhost/wordpress but I can’t login into Magento.

    Before changing those settings, the Welcome Message was still “Default welcome message” even if I was logedin into Magento.

    I’d really appreciate your help. Thanks!

  84. jeannie says:

    08:17 22/08/2011

    having problem

    wodpress toplinks not redirect to /shop

    http://localhost/checkout/cart/

    should be

    http://localhost/shop/checkout/cart/

    magento side not having pproblem.

  85. Hi Jeannie – that’s a strange issue, I’m not sure how well the plugin will function locally, it may well be that. I’ll have a look and get back to you.

    Thanks

  86. Hi Paul, Like mentioned earlier, I haven’t tested this plugin on localhost and that may well be causing you issues. It could also be if you have a WordPress Caching plugin enabled, as they may cache the HTMl as well.

  87. jeannie says:

    09:34 22/08/2011

    thank you james
    i’m not running locally..
    maybe htaccess problem in wordpress?

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

  88. Paul says:

    14:34 26/08/2011

    Did anyone tried to integrate a bilingual Magento with a bilingual WordPress?

  89. Magento Developer says:

    09:22 27/08/2011

    Great plugin. Appreciate your hard work

  90. Craig says:

    23:46 02/09/2011

    Hello,
    I just started working on activating the plugin and adding the PHP code to the Magentor head and header files.
    The URL to my Magento site is: http://rev5.575tech.com/store/
    Wordpress URL is: http://rev5.575tech.com
    When I refresh the Magento page, I’m getting this error: Fatal error: Call to undefined function wordgento() in /home/i575prod/rev5.575tech.com/store/app/design/frontend/base/default/template/page/html/head.phtml on line 51
    Thanks for any help,
    -Craig

  91. Xinix world says:

    00:10 21/10/2011

    Hi guys, great work, I need this sort of website so someone with experience of this please get in touch. I need this asap Jalal miah, xinix world

  92. Stefan Boonstra says:

    08:03 31/10/2011

    There’s also this plugin: http://wordpress.org/extend/plugins/magento/ It enables you to show your Magento store’s products on your WordPress website without having to get into any code.

  93. avel says:

    02:59 01/11/2011

    Hello,

    Great plugin btw! I am currently having problems integrating the navigation menu in the blog. The blog isnt pulling the CSS and javascripts that it needs to make it look just like the Navigation menu in the magento site at http://upgrade.standardfunctions.com

    Can anybody please help me out on what file I should edit so wordpress will pull the CSS and Javascripts. Any help pointing me in the right direction would be greatly appreciated.

    Thanks!

  94. Lorin Rivers says:

    03:24 29/11/2011

    How hard would it be for me to add a custom code block? I have the http://www.magentocommerce.com/magento-connect/sidebar-navigation-menu-4554.html pllugin installed in Magento and I’d like to use that in my WordPress site.

  95. dwu says:

    08:00 07/12/2011

    Can’t find this plugin in the WordPress Plugin Directory anymore :(

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please wrap all source code with [code][/code] tags.

Follow Tristar on Twitter