- Error
| 01 September 2009
I was astonished is to see that you cannot deactivate the payment method Paypal when the total amount is null. You will guess that is useless to have this payment method activated when nothing need to be paid. This scenario can arrived in certain circumstances otherwise Varien would not provide the payment method "No payment information is required" for Magento. I propose to you to change this behaviour by adding only three files in your installation.Here how to proceedr:
- Create a module Paypal in Magento in the following folder for example: /app/code/local/Your_name/Paypal/
- Create a folder "etc" in the previous folder created: /app/code/local/Your_name/Paypal/etc/
- Create a file config.xml with the content below (replace your_name by the wished name - name of the society or else)
- Create a file system.xml with the content below
- Activate your new module by creating the file /app/etc/modules/Your_name_All.xml with the informations below by not forgetting to replace Your_name.
- fichier config.xml:
<?xml version="1.0"?> <config> <modules> <Your_name_Paypal> <version>0.1.0</version> </Your_name_Paypal> </modules> <default> <payment> <paypal_express> <min_order_total>0</min_order_total> <max_order_total>0</max_order_total> </paypal_express> <paypal_direct> <min_order_total>0</min_order_total> <max_order_total>0</max_order_total> </paypal_direct> <paypal_standard> <min_order_total>0</min_order_total> <max_order_total>0</max_order_total> </paypal_standard> </payment> </default> </config>
- File system.xml:
<?xml version="1.0" encoding="UTF-8"?> <config> <sections> <payment> <groups> <paypal_direct> <fields> <min_order_total translate="label"> <label>Minimum Order Total</label> <frontend_type>text</frontend_type> <sort_order>98</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> </min_order_total> <max_order_total translate="label"> <label>Maximum Order Total</label> <frontend_type>text</frontend_type> <sort_order>99</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> </max_order_total> </fields> </paypal_direct> <paypal_express> <fields> <min_order_total translate="label"> <label>Minimum Order Total</label> <frontend_type>text</frontend_type> <sort_order>98</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> </min_order_total> <max_order_total translate="label"> <label>Maximum Order Total</label> <frontend_type>text</frontend_type> <sort_order>99</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> </max_order_total> </fields> </paypal_express> <paypal_standard> <fields> <min_order_total translate="label"> <label>Minimum Order Total</label> <frontend_type>text</frontend_type> <sort_order>98</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> </min_order_total> <max_order_total translate="label"> <label>Maximum Order Total</label> <frontend_type>text</frontend_type> <sort_order>99</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> </max_order_total> </fields> </paypal_standard> </groups> </payment> </sections> </config>
- File Your_name_All.xml:
<?xml version="1.0"?> <config> <modules> <Your_name_Paypal> <active>true</active> <codePool>local</codePool> </Your_name_Paypal> </modules> </config>
To finish you only need to go to your backend, Configuration > Payment method > Paypal (Express, standard or direct) and provide a minimum amount or even a maximum to display this payment method or not.







