Webspeaks

Thursday, March 31, 2011

Override Controllers in Magento

While working in Magento you may sometimes run into situations where you would like to override the functionality of the Magento core controllers. But you cannot edit the core controllers of Magento as it will hinder you from upgrading your Magento version. So we have to find a simple solution for that. Don't worry, today we will see how to override Magento core controllers.
For this, you have to create a custom module. If you do not know how to create a custom module, then read this post.
Now suppose we want to override the checkout/cart controller. To do this, we will have to edit just two files in our custom module.
Suppose our custom module is present in the namespace 'Company' and our module is named as 'Web'.

Wednesday, March 30, 2011

Implementing Moneybookers Payment Gateway with PHP

Today we will integrate a Payment gateway in our website. We are going to implement Moneybookers Payment Gateway. Moneybookers provide an easily customizable payment gateway that can be implemented without much headache. You just need to create two accounts on Moneybookers, one for the Merchant and other for the Buyer. Then send a request to Moneybookers to convert these accounts into test accounts (for testing purpose). This is a manual process as Moneybookers provide no sandbox account like PayPal for the developers. After your account has been approved as test account, you can start using it for transactions.
Moneybookers payment gateway gives you two options for the payment, either you can transfer the buyer to Moneybookers payment page or you can embed the iframe into your own page which looks more elegant. Here we will be following the second one i.e the iframe.

Tuesday, March 29, 2011

Update: Magento Frontend/Backend Modules Updated

On Request of my readers, I have uploaded the working examples of Magento frontend and backend modules. Also the previous tutorials of module creation have been modified to resolve problems.

Download links:

Download Magento Module

Download Magento Backend Module
Now you can watch the upgraded modules on:



Monday, March 28, 2011

Custom Image Upload in WordPress

Although WordPress provides a very decent feature to upload and crop images, still we may need to upload our own images in WordPress for some specific reasons. Uploading images in WordPress has been greatly eased by the image unploading functions of WordPress. Today we will see how to upload custom images in WordPress. Let us assume that we are uploading custom images to our posts. So we will need to make a reference of the uploaded image to the post. Here is the strategy for it: We will upload the image as an attachment to the post, so WordPress will return an attachment id to us. We will save this attachment id in the custom field with name 'custom_image' and value as the attachment id. So it will become easy to retrieve the custom image any time just by knowing the post id.

Saturday, March 19, 2011

Loading JavaScript Dynamically using jQuery

If you are creating a web2.0 application, then your web pages may have all possibilities of being overwhelmed with a number of JavaScript files. Including large number of JavaScript files may slow down your web page. So its a good idea to load JavaScripts dynamically to your web page, i.e load them only when these are needed. This strategy can help you reducing the load time of your web pages. Fortunately jQuery comes with a built in utility for this feature. The $.getScript function of jQuery provides us this power. The function works like simple AJAX call that includes the remote JavaScript files dynamically in our web page. Lets see the syntax of this function:
$.getScript(url,callback)

Thursday, March 10, 2011

Creating Stylish Graphs with PHP & Yahoo Charts

Few days back I was searching for some chart or Graph API to insert graphs in my web application. Then I encountered Yahoo Charts, and I start loving them in first use. Yahoo charts are very simple and customizable. And you can easily integrate them with server side language like PHP. Here I will show you the basic usage of Yahoo charts and how to integrate them with PHP. Watch it working.

Wednesday, March 9, 2011

Creating Custom Meta Boxes in WordPress

Going further in depths of WordPress today we will learn how to add Custom Meta Boxes to Write Post, Write Page, and Write Link editing pages. WordPress provides the function 'add_meta_box()' for adding meta boxes. This function takes 7 parameters which are as follows:

  • $id: HTML 'id' attribute of the edit screen section
  • $title: Title of the edit screen section, visible to user
  • $callback: Function that prints out the HTML for the edit screen section.

Tuesday, March 8, 2011

Creating Custom Post-types in WordPress

If you are thinking of converting your WordPress blog into a CMS(Content Management System), then there is nothing wrong with it. In fact WordPress has been widely used as a CMS. This is due to the fact that WordPress is so much flexible that we can do nearly any type of modification in its functionality. This time we will create custom post-types in WordPress. WordPress already provides 'posts' and 'pages' as post types, but if they don't suit your needs, you can create your own post types. So let's see how it can be done. We will create a new plugin 'Add Persons' for enabling custom post-types.

Monday, March 7, 2011

Wordpress Plugin Development for Beginners

Recently I started a project in WordPress in which I needed to create few plugins. I had no idea where to start from. But searching the web for few minutes gave me plenty of information to boost me up. So here I will show you how to create a wordpress plugin from scratch.

Thursday, March 3, 2011

In-Place Form Editing using jQuery

As a web developer you often need to play with form submissions and form editings. But at times form editing is required, it becomes very clumsy to write separate codes for editing form and submitting form. Here we will see how in-place form editing is performed so that user does not has to navigate to a separate page for form editing. Also it is very fast as only the required field can be edited irrespective of the complete form edition. Take a look at it...