How to add Magento blocks, CSS and Javascript to an external site

25 Comments

You might have a Magento based website running online and wanted to extend parts of it (also known as blocks, which may include some css and js in the code) to an external site which may either be a blog, another CMS or any other PHP based web application. If you have been following my previous posts, you will know that by adding the Mage.php file of your Magento instance to your application, you can actually pull the needed HTML blocks at any time. The only problem is that most of the examples available online asks you to use the getChildHtml(‘your-block-here’) in which most the time frustrates you because of its complexity and limited resources of how you can actually use it.

There are other ways of doing it. Oddly enough, some are pretty simple and straight forward.
More

How to add a product with custom options into Magento shopping cart from an external site?

7 Comments

This is a follow up post to a previous article I wrote on how to add products into Magento but this time the script includes custom options (attributes) of the product. I used Magento version 1.4.0.1 in this example. Just copy the whole script and save it as index.php.

More

How to fix the ‘The plugin does not have a valid header’ error when activating a WordPress plugin

2 Comments

You want to extend WordPress’ functionality and decided to download some plugins found in the Official WordPress Plugin repository. After searching the repo, you’ve found two plugins that accomplishes the tasks you needed to implement in your blog. Downloading the plugins gives you two ZIP files that when double-clicked, shows you the contents in the following format:

plugin-a.zip

plugin-a-folder
---- plugin-a-main-file.php
---- plugin-a-readme.txt

plugin-b.zip

plugin-b-folder
---- plugin-b-subfolder
-------- plugin-b-main-file.php
-------- plugin-b-readme.txt

More

Mage Enabler: A plugin to run Magento's session within WordPress

92 Comments

Mage Enabler

Update (May 12, 2010): Mage Enabler is now available in the Official WordPress Plugin repository. Get it here!

It’s been a while since I posted my tweak that allows Mage object to be utilized within any WordPress installation. The tweak requires the blog owner to modify functions.php as stated in my post. I’m inspired by the feedback of the readers who used the tweak so I decided that a plugin that does the same thing should be made to prevent modifying the WordPress core files thus preventing the tweak to cause inconsistencies when an upgrade is necessary.

More

How to use Magento’s session within WordPress

120 Comments

Update (May 11, 2010): I created a WordPress plugin for this one. Check it out here.

You have a free WordPress blog that has been online for sometime. You love its simple yet powerful way of managing your content so you’ve decided to have it hosted to a different provider in order to have a more granular control to its code and functionality. Eventually, you needed cash to support the hosting expenses so you decided to utilize your blog for e-commerce use. That’s when Magento comes in to the scene. You want to find a way to use Magento as your backend while pulling your catalog and customer information to be posted to WordPress site. This is what my article is for.

More

How to run Magento (version 1.4.0.1) session into an external site?

42 Comments

This post is an update for my blog entry on how to extend the Magento session to an external site but instead of using the version 1.2.1.2, I used the the latest stable version as of this writing which is version 1.4.0.1. The script below also implements the login() and logout() method the Magento way as well as extracting the customer data (firstname and lastname) using getCustomer() method.

More

How to Fix Magento’s Admin Login Failing (no error message) on Localhost

115 Comments

You want to install a new Magento instance (version 1.4.0.1 at the time of this writing) in your machine. You followed every steps from downloading up to the setting up of your admin account. Everything went fine so you assumed you’re good to go. You tried to login using your admin account… nothing happened. You tried again… Same login screen with no error whatsoever. You wonder what went wrong. You checked the files and the database as well as clearing the cache. You even tried resetting your account’s password found in the Magento’s admin_user table using the MD5 function thru phpMyAdmin but to no avail. You gave up and tried to reinstall everything only to be greeted by the very same login screen after clicking the Login button.

More

MS Outlook 2007 PDF Previewer

No Comments

I’ve been dealing with a lot of PDF files since I started working with my current employer. Unfortunately, Outlook 2007 which is by default installed in my machine doesn’t support PDF previewing. So for those with Windows XP OS and MS Outlook 2007 and above (yes, you read it right, version 2007+ only) you may download this nifty free application from Foxit Software which is modified by Tim Heuer (check out his blog here) to preview your PDF in Outlook in no time. Click here to download the file.

Don’t forget to thank him for this very useful app! Ciao!

How to add a product into Magento shopping cart from an external site?

15 Comments

Yes, I know. This topic has already been discussed here. But it seems the article isn’t really helpful for those people who would integrate Magento into a custom website because it will redirect the page to Magento’s default web store provided in the installation. The technique I’ll discuss here assumes that you know HTML and ofcourse familiar with Object Oriented Programming (OOP) in PHP.

More

How to delete a quote in Magento?

4 Comments

If you’re using an external site with Magento as a backend for e-commerce functionality, you will notice that the shopping cart items doesn’t get deleted after you checkout. Actually in Magento, a shopping cart is a quote. So to remove everything in the shopping cart, you must delete the quote currently used by the user. To do this, follow the code below:

More

Older Entries