Sep 26

Friday

Magento: Create New Payment Method -> Cash On Delivery

91
Comment(s)


About: How To Create a Magento Custom Module and A “Cash On Delivery” Payment Method
Who’s Interested: Informative to the semi-technically savvy
What: Custom Magento Payment Method

 

So I’ve seen more and more people raising awareness about desire to create a new payment method that allows orders to be paid via “cash on delivery” or “on pickup” by customer. Is this helpful to companies who sell to local clients? Absolutely.

 

So in offering a solution, I’ll go ahead and outline what files need to be created and why with hopes to help educate the intigued learner in how to create a Magento Custom Module as well. The benefit in knowing how to do this is modifying existing Magento functionality in a way that it will not be overwritten upon a successful Magento upgrade.

 

Thus, I’ll jump in. The following 5 files will be created (relative to one’s Magento root folder):
 

  • confix.xml
  • system.xml
  • PaymentMethod.php
  • mysql4-install-0.1.0.php
  • NewModule.xml

Here are their contents (with comments) and relative paths:

 

app/code/local/Mage/NewModule/etc/config.xml (below)

<?xml version="1.0"?>
<!--
/**
* Elias Interactive
*
* @title	  Magento -> Custom Payment Module for Cash On Delivery
* @category   Mage
* @package    Mage_Local
* @author	  Lee Taylor / Elias Interactive -> lee [at] eliasinteractive [dot] com
* @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*/

-->

<config>
<global>
<!-- declare model group for new module -->
<models>
<!-- model group alias to be used in Mage::getModel('newmodule/...') -->
<newmodule>
<!-- base class name for the model group -->
<class>Mage_NewModule_Model</class>
</newmodule>
</models>

<!-- declare resource setup for new module -->
<resources>
<!-- resource identifier -->
<newmodule_setup>
<!-- specify that this resource is a setup resource and used for upgrades -->
<setup>
<!-- which module to look for install/upgrade files in -->
<module>Mage_NewModule</module>
</setup>
<!-- specify database connection for this resource -->
<connection>
<!-- do not create new connection, use predefined core setup connection -->
<use>core_setup</use>
</connection>
</newmodule_setup>
<newmodule_write>
<use>core_write</use>
</newmodule_write>
<newmodule_read>
<use>core_read</use>
</newmodule_read>
</resources>
</global>

<!-- declare default configuration values for this module -->
<default>
<!-- 'payment' configuration section (tab) -->
<payment>
<!-- 'newmodule' configuration group (fieldset) -->
<newmodule>
<!-- by default this payment method is inactive -->
<active>1</active>
<!-- model to handle logic for this payment method -->
<model>newmodule/paymentMethod</model>
<!-- order status for new orders paid by this payment method -->
<order_status>1</order_status>
<!-- default title for payment checkout page and order view page -->
<title>Cash On Delivery</title>
</newmodule>
</payment>
</default>
</config>

app/code/local/Mage/NewModule/etc/system.xml (below)

<?xml version="1.0"?>
<!--
/**
* Elias Interactive
*
* @title	  Magento -> Custom Payment Module for Cash On Delivery
* @category   Mage
* @package    Mage_Local
* @author	  Lee Taylor / Elias Interactive -> lee [at] eliasinteractive [dot] com
* @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*/

-->

<config>
<sections>
<!-- payment tab -->
<payment>
<groups>
<!-- newmodule fieldset -->
<newmodule translate="label" module="paygate">
<!-- will have title 'Cash On Delivery' -->
<label>Cash On Delivery</label>
<!-- position between other payment methods -->
<sort_order>670</sort_order>
<!-- do not show this configuration options in store scope -->
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<fields>
<!-- is this payment method active for the website? -->
<active translate="label">
<!-- label for the field -->
<label>Enabled</label>
<!-- input type for configuration value -->
<frontend_type>select</frontend_type>
<!-- model to take the option values from -->
<source_model>adminhtml/system_config_source_yesno</source_model>
<!-- field position -->
<sort_order>1</sort_order>
<!-- do not show this field in store scope -->
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</active>
<order_status translate="label">
<label>New order status</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_order_status</source_model>
<!--<source_model>adminhtml/system_config_source_order_status_new</source_model>-->
<!--<source_model>adminhtml/system_config_source_order_status_processing</source_model>-->
<sort_order>4</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</order_status>
<allowspecific translate="label">
<label>Payment from applicable countries</label>
<frontend_type>allowspecific</frontend_type>
<sort_order>50</sort_order>
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</allowspecific>
<specificcountry translate="label">
<label>Payment from Specific countries</label>
<frontend_type>multiselect</frontend_type>
<sort_order>51</sort_order>
<source_model>adminhtml/system_config_source_country</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</specificcountry>

<title translate="label">
<label>Title</label>
<frontend_type>text</frontend_type>
<sort_order>2</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</title>
</fields>
</newmodule>
</groups>
</payment>
</sections>
</config>

app/code/local/Mage/NewModule/Model/PaymentMethod.php (below)

<?php
/**
* Elias Interactive
*
* @title	  Magento -> Custom Payment Module for Cash On Delivery
* @category   Mage
* @package    Mage_Local
* @author	  Lee Taylor / Elias Interactive -> lee [at] eliasinteractive [dot] com
* @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*/

class Mage_NewModule_Model_PaymentMethod extends Mage_Payment_Model_Method_Abstract
{
protected $_code  = 'newmodule';
//protected $_formBlockType = 'payment/form_checkmo';
//protected $_infoBlockType = 'payment/info_cod';

/**
* Assign data to info model instance
*
* @param   mixed $data
* @return  Mage_Payment_Model_Method_Checkmo
*/
public function assignData($data)
{
$details = array();
if ($this->getPayableTo()) {
$details['payable_to'] = $this->getPayableTo();
}
if ($this->getMailingAddress()) {
$details['mailing_address'] = $this->getMailingAddress();
}
if (!empty($details)) {
$this->getInfoInstance()->setAdditionalData(serialize($details));
}
return $this;
}

public function getPayableTo()
{
return $this->getConfigData('payable_to');
}

public function getMailingAddress()
{
return $this->getConfigData('mailing_address');
}

}

app/code/local/Mage/NewModule/sql/newmodule_setup/mysql4-install-0.1.0.php (below)

<?php
// here are the table creation/updates for this module

app/etc/modules/NewModule.xml (below)

<?xml version="1.0"?>
<!--
/**
* Elias Interactive
*
* @title	  Magento -> Custom Payment Module for Cash On Delivery
* @category   Mage
* @package    Mage_Local
* @author	  Lee Taylor / Elias Interactive -> lee [at] eliasinteractive [dot] com
* @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*/
-->
<config>
<modules>
<!-- declare Mage_NewModule module -->
<mage_NewModule>
<!-- this is an active module -->
<active>true</active>
<!-- this module will be located in app/code/local code pool -->
<codePool>local</codePool>
<!-- specify dependencies for correct module loading order -->
<depends>
<mage_Payment />
</depends>
<!-- declare module's version information for database updates -->
<version>0.1.0</version>
</mage_NewModule>
</modules>
</config>

Again, this serves as a basic configuration for a new payment method that allows Cash On Delivery and is written as a Magento Custom Module. Modifying these files may be necessary, though this should be a good outline to get you started. Any help needed, post here and we’ll get some dialogue going to find solutions for your needs.

Or simply download the files here:

Elias: Cash On Delivery (Magento Payment Method)

 

 


View Comments



Branko Ajzele says:

October 8th, 2008 at 11:40 pm


Great work, nice article. Informative and educational. Thank you for sharing it with community.


timothyleetaylor says:

October 10th, 2008 at 8:46 am


Branko,

We’ve been excited about Magento for some time now. We’ve also had a chance to dialogue with you some and gain a better appreciation for your involvement in the Magento community.

Let us both keep up making progress with Magento on behalf of the community!

Thanks for the encouragement.

Hope to connect again soon,
Lee


Tomislav Bilic says:

October 17th, 2008 at 6:31 am


Hey man,
Many thanks for this tutorial. Looks very helpful to get started.


timothyleetaylor says:

October 17th, 2008 at 8:08 am


Thanks Tomislav,

Great to hear from you, and I do hope this tutorial is beneficial in your endeavor to write a custom payment module.

I was wondering, would you suggest any other topics about Magento that you’d like to hear or know more about?

Let’s get a list rolling and begin writing on the most valuable topics the Magento community can benefit from.

Thanks for your input,
Lee Taylor


Tomislav Bilic says:

October 17th, 2008 at 8:16 am


Hehe. It was a coincidence that I found your article on Google, especially because Branko made the 1st comment. Two of us work at the same office in one small town in Osijek, Croatia and both of us came your way via separate paths :)


timothyleetaylor says:

October 17th, 2008 at 8:31 am


That coincidence is fun to hear about :)

In that case since you’re working alongside Branko,I recognize much-needed topics that will benefit the Magento community have already been approached in an ongoing manner here: http://activecodeline.com/

We’re excited for your community involvement, and are glad for the opportunity to contribute as well.

Feel free to jot down thoughts on topics you’d like to hear about as they come to mind. Nonetheless, we’ll keep on blogging about the design, development, and marketing of Magento!

Lee


osdave says:

November 13th, 2008 at 7:32 am


hi timothy,
As Tomislav has no suggestion I have one, if I may :)
I’ve learned php with osc: I realize then now that I’m programing in a XXth century way. I’ve discovered Magento and love it and see this an oportunity for me for learning he XXIth century way of programing.

I’m studying now all I can find about OOP and Zend framework: that isn’t easy but surely worth it.
Here comes my request: where to start in order to discover Magento’s code? Is there some logic I should keep in mind when I need to find some piece of code I want to see/change?
You know, a tutorial about Magento’s code for beginers.

Thanks in advance. Cheers.
david


Branko Ajzele says:

November 13th, 2008 at 8:37 am


Hi there “osdave”… In my modest opinion, Zend Framework is the way to go, especialy if you are interested in Magento. I too am on the path of learning and hopefully mastering Zend.

There are people who will say Zend is fat as framework, use CodeIgniter, or PHPCake or Symphony or… Whatever the case may be, Zend is recognized as Enterprise ready, it comes with full certification program, it’s documentation is great and so on… in short; you can’t go wrong if you choose to go with Zend.


osdave says:

November 13th, 2008 at 12:37 pm


hi Branko, thanks for your comment. Let’s go for Zend then :)
Your blog will also certainly helps me in this journey, see you there


timothyleetaylor says:

November 13th, 2008 at 2:16 pm


Hi @osdave and Branko,

So great to have you both interacting here. I’m just catching onto the dialogue, and think Branko’s got a great perspective on jumping into Magento by initially learning the Zend framework.

I recognize a couple ways of going about Magento customization. For theme customizations, one can often l learn by comparing the code with the frontend of the theme (via Magento theme notes AND Firefox Firebug tool). In this manner, learning theme customization techniques can be self-learned automatically by adjusting the visual part of the Magento theme.

But I think you’re referring to Magento core code customization more specifically. And with our combined experience, we agree that learning the Zend Framework (which has made available some great tutorials and videos) is key.

As you get familiar more with Object Oriented Programming, I believe you’re going to see GREAT value in utilizing the concepts it has to offer. Here’s a link that might get you started actually: http://devzone.zend.com/node/view/id/627

As I understand it, Magento is written with the intention of not just utilizing the basic OOP concepts, but enhancing code re-usability and efficiency with the Zend Framework.

They’re still making changes, as we’re all growing alongside them. Let’s keep the dialogue up, and post all kinds of thoughts/questions here and there so we can help each other out.

All the best,
Lee


osdave says:

November 14th, 2008 at 3:29 am


hi Lee, thanks for answering.
The link to the devzone seems very interesting for me right now, as I’m revising the base of PHP. I’ll focus on parts 7 and 11 (OOP and XML) as these are both concept I am less confident with and very important for Magento (and I guess for good PHP programing).
So, thanks again for your time and I’ll check your future posts, keep up the good work :)
cheers, dave


Tonitobleroni says:

November 15th, 2008 at 2:15 pm


Hi,
Thanks a lot for your work, but unfortunately the payment option doesn’s show up in frontend. It does in Admin->Configuration->Payment methods and I have enabled it. Also, I have refresed cache. Any idea what I did wrong? Thanks in advance!


timothyleetaylor says:

November 17th, 2008 at 2:08 pm


Hi @Tonitobleroni,

Thanks for your inquiry. Can I ask what version of Magento you are using? Also, you can try to manually refresh the cache by removing all contents from the following path: var/cache/

Try that and mention what version of Magento you are using. Make sure the payment option is enabled, and we’ll see what we can troubleshoot from there.

Thanks,
Lee


timothyleetaylor says:

November 17th, 2008 at 2:11 pm


@osdave,

That sounds like a great plan for getting started. Also, once you do get an idea for the architecture of Magento (and better seeing at a high-level how everything fits together), you can attempt to go through this payment module piece by piece to see why the code is there and how it interacts with the other files inside the module.

If you have any questions, post them here. Understanding the module may not seem as overwhelming, and it also plugs right into the Magento code with OOP concenpts (like overriding controllers with OOP practices in mind). Thanks, and all the best with your learning – as I’m doing it right with you every day =) It never stops!

- Lee


Tonitobleroni says:

November 17th, 2008 at 2:33 pm


Hello Lee,
Thanks a lot for your response. I manually removed all content from the cache folder. I am using 1.1.6. I have enabled the payment option in Admin.
Thanks in advance!


Tonitobleroni says:

November 17th, 2008 at 2:34 pm


…and, needless to say, it still doesn’t show up in frontend…


timothyleetaylor says:

November 17th, 2008 at 3:00 pm


Hey @Tonitobleroni,

Please visit this post and read up about some solutions others have found when dealing with this type of issue: http://www.magentocommerce.com/boards/viewthread/832/P45/#t10489

Unfortunately, without being able to look into the code you have (as various setup options can be prohibiting this from showing up on the frontend), it is hard for me to troubleshoot. Also, some questions I might cover with you are already located within the forum post mentioned.

Lastly, if you don’t find any solution there, you may try a quick install of another Magento store and see if the module works from the fresh install.

I haven’t had time to go in and verify that the code be relevant for Magento version 1.1.6 yet, though I haven’t seen anyone else having a problem with this – so it’s not likely there is any upgrade issues involved.

Thanks,
Lee


Tonitobleroni says:

November 17th, 2008 at 4:17 pm


Thanks Lee, I will dig through the post you provided. Thanks for your help!


sirvash says:

November 18th, 2008 at 5:17 am


Hi,

Could you suggest me how to configure the this module in own magento application. when i putted the all files in my local system this is not overriding the default shipping method of magento.


timothyleetaylor says:

November 18th, 2008 at 1:15 pm


Hi @sirvash,

I’d love to recommend how to configure this module in your own Magento application, though with all the possibilities, it would probably turn into a small project rather than a couple discussions.

In reference to the issue you mentioned, make sure you haven’t changed the name of the default shipping method of Magento. Also, I’d recommend going back and make double-checking that the files were copied into the correct folders (reference the paths in the download we have available).

Please contact us via our contact form below if you’d like help on a project, and we’d be glad to assist you.

Thanks!
Lee


Sirvash says:

November 18th, 2008 at 11:23 pm


Hi @Lee,

Special Thanks for quick solutions i am trying to update the title of ‘Cash on Delivery’ and updated the system.xml and config.xml but modification not visible on front.

Please assist me.
module working fine now can i update the shipping method i just wanna to save and extra value instead of the ‘Flat Tax’ on sales order table.

Thanks
Sirvash Sharma


timothyleetaylor says:

November 19th, 2008 at 2:50 pm


Hi @Sirvash,

We’ve had someone else inquire as to a similar issue. My response can be found here: http://eliasinteractive.com/blog/magento-create-new-payment-method-cash-on-delivery/#comment-64

Thanks,
Lee


Leslie says:

December 10th, 2008 at 4:02 pm


Hi Folks,

I see that this thread is for COD but I’m also attempting to create a Magento payment module for USAePay payment module using the Magento create payment gateway instructions.

I am having a parser error issue with the
app/code/local/Mage/Usaepay/Model/PaymentMethod.php file and I wonder if you could help me fix it. If yes, could I send you the php code for this file? Here is the error:

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity:
line 133: parser error : Opening and ending tag mismatch: usaepayach line 107 and payeach in
/home/the/domains/silverborn.com/public_html/lib/Varien/Simplexml/Config.php
on line 500

Thank you,
Leslie


Pankaj says:

December 26th, 2008 at 12:09 am


I have made this but it is looking in the advanced section but not in the payment method in the Admin panel.I need it with the credit card details.


Thirupathi says:

January 2nd, 2009 at 8:07 am


I had created Payment Module as it is in my local system
Magento: Create New Payment Method -> Cash On Delivery

but the new module is not displaying in admin/system/configuration

same as another one created fallowed by

http://www.magentocommerce.com/wiki/how-to/create-payment-method-module

it is also same problem

please any one suggest me what is the problem


Nishant says:

January 4th, 2009 at 10:15 pm


hi can u tell me how can i add another field to new product addition(Create product setting.)..m using version 3.0


nishant says:

January 4th, 2009 at 10:32 pm


hi!
i just want to know how can i know which file is showing the current page content of magento so that if i want to modify it then i can do it….
And yes dear m just a beginner…


Younus says:

January 11th, 2009 at 6:15 am


Hi Lee,

I’m using magento-1.1.8. I’ve followed your steps creating 5 files in appropriate directories. But unfortunately in Admin->Configuration->Payment methods, I can’t see any update. I have refreshed cache but no results. Can you say please where I’m doing wrong ?
Thanks in advance.


timothyleetaylor says:

January 16th, 2009 at 12:09 am


Hi All,

As I see, there’s been a bit of activity that I haven’t had time to get to. My apologies here. I haven’t needed to update this for Magento’s new 1.2 version, so I haven’t tested it against the upgrades Magento has made. Unfortunately, I haven’t had time to update it – though I assume there’s some adjusting to the “system.xml” file regarding displaying correctly within the Admin->Payment Methods.

I’ll post again when time opens up. Until then, keep testing and post your successful findings on the blog here!

Thanks for all community contributions,
Lee


Anton Olsen.com » Blog Archive » Bookmarks for February 10th says:

February 10th, 2009 at 5:02 pm


[...] How To Write Magento Custom Module: Cash On Delivery Payment Method | EliasConcise howto on writing a magento module. [...]


neo says:

February 22nd, 2009 at 8:25 pm


Hi, I just tried your post, but it’s not shown in configuration->payment methods tab but in configuration->advanced tab. My magento version is 1.2.1.
Can u show me the solution.
Thanks in advance.


neo says:

February 22nd, 2009 at 11:40 pm


I had some wrong but I fixed it and now it’s shown in payment methods tab. It’s really great work. Thank you very much, Lee!


Eddie says:

February 26th, 2009 at 12:01 pm


Hi,
Thanks for this tutorial. However, when I do an order from within admin, the COD payment method is not available, even tho’ I’ve enabled in Configuration.

I’m running ver 1.2.0.3. Any suggestions?

Thanks,
Eddie


Ela says:

March 6th, 2009 at 4:25 am


Hola,

Thank you very much for this tutorial! It works fantastic! Just a little question: The new payment is the first one in the frontend now. How can I change the sort order? Thanks! ela :)


Sabarish says:

March 21st, 2009 at 4:51 am


hi timothyleetaylor,

I am New to this both Magento and Zend Framework. I Just tried ur Steps to create a payment module. Unfortunately i cant able to succeed in it. its throwing me a warning…

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : XML declaration allowed only at the start of the document in E:\magento\lib\Varien\Simplexml\Config.php on line 500

can u please tell me wr i did a mistake and how to resolve this.

Thanks & Regards,
Sabarish V


Lee Taylor says:

March 22nd, 2009 at 9:14 pm


Hey there @Sabarish,

That error tends to be a result of something going wrong within your config.xml or system.xml file inside the module directory. Be sure to check unnecessary whitespace and invalid characters (which happens sometimes if copying and pasting).

Hope you find a solution that results from digging around those two files.

Cheers!
Lee


Younus says:

March 22nd, 2009 at 9:49 pm


Hi Sabarish,

You can go through the following link to integrate the New Payment Method.

http://www.magentocommerce.com/boards/viewthread/832/P195

I’ve integrate the method with magento 1.1.8.
Its also working with ver-1.2.0.3.

Thanks
Younus


Lee Taylor says:

March 22nd, 2009 at 9:56 pm


Thanks for the input here all!


Sabarish says:

March 25th, 2009 at 5:01 am


HiYounus,

Thanks for the Input Its works fine for me. Sorry for the late response Bcoz i was struck with other works. Again i need another input from u all guys. How to integrate the new Module with the Existing Modules. Do u have any reference link kindly let me know

Thanks & Regards,
Sabarish


Welche Extensions nutzt Ihr? – rack::SPEED Support-Forum says:

April 17th, 2009 at 12:49 am


[...] hatte durch Zufall noch dieses HowTo gespeichert: How To Write Magento Custom Module: Cash On Delivery Payment Method | Elias Interactive Die Basis des Moduls ist relativ einfach gestrickt und sollte auch mit neueren Magento-Versionen [...]


eshban says:

April 19th, 2009 at 12:13 pm


thanks for this tutorial, i need a little guidance.

I need to create a magento module that sends variables to a payment gateway page.

Can you please guide me in this regard?


Marcio says:

April 20th, 2009 at 2:17 pm


Hy

I create a field

In

class Cerebrum_Visa_Block_Standard_Form extends Mage_Payment_Block_Form

Ok, appear in Font-End in E-commerce

————
But

How to get the variable “visa_type” content, to Show in the E-commerce


dan says:

May 5th, 2009 at 5:35 am


What about giving only special customers the option of cash on delivery?


dan says:

May 5th, 2009 at 5:38 am


What I mean is, say I have a list of user accounts maintained through the admin panel. What then if I create a group called “vips” and then only when they are logged in they can see the payment option “Cash on Delivery”.

We would not want to deliver a heavy valuable package to someone whom we did not trust to give them the COD treatment!


Linus says:

May 13th, 2009 at 6:29 am


This is great if it works, can´t you release it on magento connect?


vas says:

May 26th, 2009 at 12:23 am


Hi, all

I have created new payment module. it display on admin panel as well as on frontend. now i want that when user click on place order user will redirect to new window like any iframe and in that user will enter all the details and continue….

pls anyone help me how to do this….. pls..pls…

thanks,


anonymousmagentonewbie says:

May 26th, 2009 at 3:21 am


does this work with magento 1.3+ ?


vas says:

May 30th, 2009 at 4:59 am


No one has answer of my question??? regarding redirect to new iframe for payment.


Helen says:

June 1st, 2009 at 3:31 pm


This is somewhat off topic, but I haven’t been able to get any help at the Magento forums.

Sounds like you know what you’re doing, maybe you know the deal with this?

Thanks in advance!

Here’s my issue:

- I added a new module using ModuleCreator.

- Was able to activate it via Configuration -> Advanced.

- The new module MENU tab shows up in the Admin section, but when I click on the button, it takes me to a blank page.

- I’m using “default” theme for the backend, and a custom theme for the frontend. However, this new button takes me to a blank page styled using my custom theme.

So my question is—where can I see this custom module admin page? Is it a php, xml or phtml file?

I want to add content to it, and if possible, change it to “default” theme like the rest of the admin section.


mushir says:

June 10th, 2009 at 3:19 am


how can i add one new form before registration page on front-end for magento ?

when customer can click on registration first of all open new form where customer can enter city name and that city will be in system then register form will appear otherwise display sorry msg.

pls help me

http://mushirkureshi.blogspot.com


khushwant says:

June 11th, 2009 at 12:35 pm


Hello Lee,

I m new to magento. Can u give me a good and easy resource to get started with magento and zend.

Thanks
khush


alp says:

July 12th, 2009 at 5:28 am


Thanks for this great tutorial! How can i set up the script to send notification mail which informs customer after “cash on delivery” order. Briefly, i need custom mail template and the required mail script for cash on delivery. I also want to be in bcc as an admin.
Any help will be appreciated


jazkat says:

July 20th, 2009 at 8:40 am


Heya guys,
first I must say I really appreciate your effort in serving Magento community! That goes for Croatian team as well!

I am also interested in knowing whether this module works in 1.3.x. I am gonna try it anyway and let you know the results.

However, I am still kinda confused about Magento updates. The thing is I am modifying the system quite a bit plus thinking of using lots of extensions. I mean, I am aware the system needs to stay safe, however, the possibility of having to modify code after every update makes me, well, not happy.
Anyway, I know this is a different topic, it just bothers me extensively.


freshwebservices says:

July 21st, 2009 at 1:02 am


Hi jazkat,
If you use your own modules to modify Mage behaviour/functionality, then you have less to worry about when upgrading. However, if you modify core code, then this is a problem when upgrading – you’ll have to use a diff tool to compare the new code against your modified version and then merge the 2 if you can.
So if possible, figure out how to create your own module to do modifications – often ‘all’ you have to do is copy the file you want to modify into app/code/local/yourfolder and then publish it as a module, having informed Mage to use your module rather than the default.
Best wishes,
Eddie


jazkat says:

July 23rd, 2009 at 7:54 am


Hi Eddie,
thanks a lot, this makes sense. I was actually going to create my own modules and not change core files, so that means I was on the right path not to complicate my life :-)
You put my mind at ease :-)


Abdul says:

July 28th, 2009 at 2:42 am


Hi all,

This is great tutorial to get started. I’ve an assignments. I need to build a custom module in magento. I’m new to magento. I need to build a clone of http://www.brooksbrothers.com/selectshirts/selectshirts.tem#. Can anybody guide me how to start this kind of module/functionality in magento. Hope to hear from you people. Thanks in advance.


Lee Taylor says:

July 28th, 2009 at 1:10 pm


Hi All,

Glad all is well and things are getting sorted. Thanks for helping out everyone. We have been busy working on a few internal projects that we’ll look forward to presenting to the Magento community soon.

Keep up the progress!

Cheers!
Lee


Lee Taylor says:

July 28th, 2009 at 1:11 pm


Hi @Abdul,

From the link you gave us, it looks like this kind of functionality is more related to a “product configurator” rather than an actual payment gateway. The payment gateway would need to happen once the products are added to the cart and the user is sent to the checkout process.

All the best in finding the right solution!

Cheers,
Lee


Abdul says:

July 29th, 2009 at 12:09 am


Hi @Lee Taylor,

Thanks for reply.


How to: Magento eCommerce help and tutorials | says:

July 29th, 2009 at 3:34 pm


[...] How To Write Magento Custom Module: Cash On Delivery Payment Method [...]


pippo says:

August 3rd, 2009 at 9:33 am


hi! i configured the module and works fine, but i would like that my country selection for the cash on delivery availability, refers to shipping country, not the billing one. someone can help me? thanks in advance


Juan Siesquen says:

August 3rd, 2009 at 4:12 pm


Hi Men!

I want to create a payment module which can communicate to a web service. I have problems displaying lists of coins recovered dynamically. Any idea?

When ending the develop I publish… excuse me my english. :P

Regards Friends!


Peter Money Maker says:

August 7th, 2009 at 7:24 am


Great idea, thanks for this tip!


Vishnu Bhatia says:

August 16th, 2009 at 8:49 am


Dear Timothy,

First of all thanks a lot for the module. I have installed it on Magento 1.3.1 and it work great. We have added an additional fee as COD charges and it works great on front end. However, the problem comes when I have to modify an existing order or create a new order. It simply does not count the additional charges and the total of the order is having only the shipping charges added. Can anyone who has faced the similar issue, guide me how to solve this issue?

Regards.


Pavel says:

August 25th, 2009 at 10:19 am


Thank you so much for valuable information.

Is there some easy way to add suplemental fee for this payment method.


Ron Peled says:

August 28th, 2009 at 6:17 pm


I think your post does a better job explaining how to create a payment module for magento that the wiki page they have on the magento community site. Good job!


Rohan says:

September 12th, 2009 at 5:38 pm


Totally agree with Ron above. The Magento wiki is complete crap by comparison.

One question I have which is confusing the hell out of me, is about the PaymentMethod.php file.

How does this file get referenced by the payment method?

The only reference I can find to it is in the config.xml file which says:

newmodule/paymentMethod

there is a folder called

app\code\local\Mage\NewModule\Model

and inside of that there is PaymentMethod.php

is this the same file that is referenced in config.xml ??


yogesh says:

September 14th, 2009 at 7:10 am


Hello,
This is nice tutorial but can you please provide me any help on how to create credit card accepting payment module for magento.
I followed some url’s but they all are very basic and not even with any information like how to pass hidden values from client side while checkout..How to change fields name etc…
Please help me asap…


Rianti says:

October 1st, 2009 at 9:29 am


Hi, thanks for this. I’ve implemented it on v 1.2.1.2 and it works great! :-) I’ve also added a new “message” field to this module (”Please call xxxxxxx to arrange delivery time”). It shows up in admin but doesn’t show the message when I choose this payment method on checkout. Anyone can help me with this?

Much appreciated,

Rianti


momleepost says:

October 8th, 2009 at 7:35 am


We like to know how to the custom payment redirect to the payment process url when we submit the place order button.


Ajax and PHP Developer says:

October 13th, 2009 at 11:01 am


Hey,

I was building a checkout module and this helped figure out some dearly needed stuff. It is just a bit off from what I need but I learned a lot. Thank you.


Aryan-Ali says:

October 28th, 2009 at 1:08 am


Great work dear
can any one guide me about ?
how can i add the realted data base tables?
or how many tables are required for this module ?

please anser me as soon as posible ………..!


ertarunz7 says:

November 2nd, 2009 at 2:07 am


Hello All,

I’m new to Magento .. and i want to develop a module
“Vendor rating system like that of ebay”.. In Magento .. can any when suggest me where to start from .. As i had no idea regarding this .

Any help will be great ..

Thanks a lot in advance.


Bruno Alexandre says:

January 4th, 2010 at 12:36 pm


Can you please make downloadable file available.

Thank you and Congrats for the article.


Thillai says:

January 28th, 2010 at 12:54 am


Hi

I downloaded the module its working fine in magento with single admin site. When i use the module with multiple websites , am getting an error message in the backend . But the module is working fine in the frontend.Update me and let me know the what the issue is and how can i resolve this issue.


Maz says:

January 29th, 2010 at 4:53 am


Hello, I am new on this. I created a module using your tutorial but after creating the module I couldn’t enter to my admin panel..it shows following error.

Module “mage_PaymentModule” requires module “mage_Payment”

Help is highly appreciated! Thanks!


Bill Thomas says:

February 9th, 2010 at 5:52 pm


Maz:
The problem is probably in the app/etc/modules/Mage_NewModule.xml

mage_Payment needs to be Mage_Payment. Capital M


optical says:

March 11th, 2010 at 7:11 am


I’m trying to create multiple modules using the same template but I notice the subsequesnt ones are not showing. It’s enabled and I get no errors. Is it a sort number value issue?


optical says:

March 11th, 2010 at 7:15 am


let me rephrase my question. If I need to create multiple new methods, which variable will I need to change? I changed the NewModule variable but I can only get one method to show up in the backend. The other new method shows it’s enabled in Advanced but I dont’ see it on the Payment Methods.


ben says:

April 9th, 2010 at 11:53 am


Although I am writing a custom payment module for Magento (what a learning curve!) which is a bit more complicated stuff, I would appreciate some advice. After creating the module I can setup my custom setting of the created payment method in the Payment Methods Magento admin section, but when I enable the payment method and go to the checkout, the Payment Information doesn’t contain the option for my enabled payment option. I have disabled the cache while debugging, so it can’t be the fault. cheers


Charles G says:

April 21st, 2010 at 4:57 am


Hello Lee,

Many thanks for this contibution.
I have managed to add a new payment method based on your tutorial and I am very happy with it.
The only problem I have with any new payement modules I write from scratch is that they will cause an error in the admin panel when you attempt to check an order/change the status of an order that was placed using this payement.
So In the admin section , if I go to sales/orders and try to edit the last order made with the newpayement I get this error:

Warning: include(/home1/……/app/design/adminhtml/default/default/template/POD1/info.phtml) [function.include]: failed to open stream: No such file or directory in /home1/… …//app/code/core/Mage/Core/Block/Template.php on line 144

Any idea how I can resolve that little bugger ? Is the module missing some template files in the adminhtml ?

Thanks

Charles G


Jose says:

April 29th, 2010 at 8:18 am


Hello Elias,

Do you konw if is posible disable this option of payment for downloadable and Virtual products?

Thanks :-)


J.S. Coolen says:

May 14th, 2010 at 11:32 am


The download link doesn’t wotk anymore, does anyone has the files for me?


rover says:

July 12th, 2010 at 2:58 am


Hi,

Everyone, I’m new here and in Magento. Can you give me an idea how to integrate or create new payment module mehod PesoPay. Like what I said, I’m new in Magento and I really can’t caught an idea where and how to start creating this module. Thank you very much for the help.


rover says:

July 13th, 2010 at 11:28 pm


Hi,

I just want to ask that how and where is the module of paypal payment method where it send the buyers information and total amount of the customer’s bought product. Please help me with this. Thank you in advance.


rover says:

July 14th, 2010 at 1:47 am


Hi,

Guys, I having a problem when I clicked “Checkout: in my magento.

Fatal error: Call to a member function setStore() on a non-object in C:\xampp\htdocs\magento\app\code\core\Mage\Payment\Helper\Data.php on line 72

anyone can help? Thank you


jeet says:

July 14th, 2010 at 9:27 am


I need to integrate a new payment module called ‘MegaPos’ . Dont know how to move. any help would be highly appreciated.


Sunil Mohapatra says:

July 17th, 2010 at 2:38 am


I desperately need the multi payment gateway module called ‘Megapos’.Please need some help.

Thanks…


kivin says:

August 5th, 2010 at 5:28 am


my modudle going error, here show:
Module “mage_NewModule” requires module “mage_Payment”
Trace:
#0 D:\Program Files\Zend\Apache2\htdocs\magento1324\app\code\core\Mage\Core\Model\Config.php(680): Mage::throwException(’Module “mage_Ne…’)
#1 D:\Program Files\Zend\Apache2\htdocs\magento1324\app\code\core\Mage\Core\Model\Config.php(645): Mage_Core_Model_Config->_sortModuleDepends(Array)
#2 D:\Program Files\Zend\Apache2\htdocs\magento1324\app\code\core\Mage\Core\Model\Config.php(233): Mage_Core_Model_Config->_loadDeclaredModules()
#3 D:\Program Files\Zend\Apache2\htdocs\magento1324\app\code\core\Mage\Core\Model\App.php(263): Mage_Core_Model_Config->init(Array)
#4 D:\Program Files\Zend\Apache2\htdocs\magento1324\app\Mage.php(434): Mage_Core_Model_App->init(”, ’store’, Array)
#5 D:\Program Files\Zend\Apache2\htdocs\magento1324\app\Mage.php(455): Mage::app(”, ’store’, Array)
#6 D:\Program Files\Zend\Apache2\htdocs\magento1324\index.php(65): Mage::run()
#7 {main}


nabler says:

August 5th, 2010 at 10:05 pm


Yeah i got the pretty error after i follow your tutorial….I use magento 1.4.0.1


Vasashiner says:

August 18th, 2010 at 7:56 pm


Module “mage_NewModule” requires module “mage_Payment”
Trace:
#0 E:xampphtdocsvasa_magentoappcodecoreMageCoreModelConfig.php(680): Mage::throwException(’Module “mage_Ne…’)
#1 E:xampphtdocsvasa_magentoappcodecoreMageCoreModelConfig.php(645): Mage_Core_Model_Config->_sortModuleDepends(Array)
#2 E:xampphtdocsvasa_magentoappcodecoreMageCoreModelConfig.php(233): Mage_Core_Model_Config->_loadDeclaredModules()
#3 E:xampphtdocsvasa_magentoappcodecoreMageCoreModelApp.php(263): Mage_Core_Model_Config->init(Array)
#4 E:xampphtdocsvasa_magentoappMage.php(434): Mage_Core_Model_App->init(”, ’store’, Array)
#5 E:xampphtdocsvasa_magentoappMage.php(455): Mage::app(”, ’store’, Array)
#6 E:xampphtdocsvasa_magentoindex.php(65): Mage::run()
#7 {main}

Leave a comment




blog comments powered by Disqus