cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Payment Method not showing on checkout

SOLVED

Custom Payment Method not showing on checkout

Hi there,

 

I am developing a custom payment method, everything is fine in the admin but it's not showing on checkout.

This is my block:

 

class ShoppingPlus_SPPayment_Block_Form_SPPayment extends Mage_Payment_Block_Form
{
  protected function _construct()
  {
    parent::_construct();
    
    $this->setTemplate('sppayment/form/sppayment.phtml');
  }
}

this is my model:

<?php
class ShoppingPlus_SPPayment_Model_Method_Sppayment extends Mage_Payment_Model_Method_Banktransfer {
	protected $_code = "sppayment";
}

the config:

<?xml version="1.0"?>
<config>
    <modules>
        <ShoppingPlus_SPPayment>
            <version>0.0.1</version>
        </ShoppingPlus_SPPayment>
    </modules>
    <global>
        <helpers>
            <sppayment>
                <class>ShoppingPlus_SPPayment_Helper</class>
            </sppayment>
        </helpers>
        <blocks>
            <sppayment>
                <class>ShoppingPlus_SPPayment_Block</class>
            </sppayment>
        </blocks>
        <models>
            <sppayment>
                <class>ShoppingPlus_SPPayment_Model</class>
            </sppayment>
        </models>
    </global>
    <default>
        <payment>
            <sppayment>
                <model>sppayment/sppayment</model>
            </sppayment>
        </payment>
    </default>
</config>

and the system:

<?xml version="1.0"?>
<config>
    <sections>
        <payment>
            <groups>
                <sppayment translate="label" module="sppayment">
                    <label>Shopping Plus Payment</label>
                    <frontend_type>text</frontend_type>
                    <sort_order>1000</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <active translate="label">
                            <label>Enabled</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>0</show_in_store>
                        </active>
                        <title translate="label">
                            <label>Title</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>10</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </title>
                        <order_status translate="label">
                            <label>New Order Status</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_order_status_new</source_model>
                            <sort_order>20</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>0</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>0</show_in_store>
                            <can_be_empty>1</can_be_empty>
                        </specificcountry>
                        <instructions translate="label">
                            <label>Instructions</label>
                            <frontend_type>textarea</frontend_type>
                            <sort_order>62</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </instructions>
                        <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>
                        <sort_order translate="label">
                            <label>Sort Order</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>100</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>0</show_in_store>
                        </sort_order>
                    </fields>
                </sppayment>
            </groups>
        </payment>
    </sections>
</config>

any suggestion?

 

Thanks a lot

7 REPLIES

Re: Custom Payment Method not showing on checkout

Does it show up in admin?

Magento Moderator since 2009
Keep Calm and Clear Cache!

Re: Custom Payment Method not showing on checkout

Hi,

 

yes it does. Actually I've just tried to simplify the camelize-thing, and now it shows also on checkout, but still the block is not being called IMO.

 

here is the new config:

 

<?xml version="1.0"?>
<config>
    <modules>
        <Shoppingplus_Sppayment>
            <version>0.0.1</version>
        </Shoppingplus_Sppayment>
    </modules>
    <global>
        <blocks>
            <sppayment>
                <class>Shoppingplus_Sppayment_Block</class>
            </sppayment>
        </blocks>
        <helpers>
            <sppayment>
                <class>Shoppingplus_Sppayment_Helper</class>
            </sppayment>
        </helpers>
        <models>
            <sppayment>
                <class>Shoppingplus_Sppayment_Model</class>
            </sppayment>
        </models>
        
    </global>
    
    <default>
        <payment>
            <sppayment>
                <model>sppayment/sppayment</model>
            </sppayment>
        </payment>
    </default>
    
    <frontend>
		<routers>
		  <sppayment>
			<use>standard</use>
			<args>
			  <module>Shoppingplus_Sppayment</module>
			  <frontName>sppayment</frontName>
			</args>
		  </sppayment>
		</routers>
	</frontend>
    
</config>

the new model:

<?php

	class Shoppingplus_Sppayment_Model_Sppayment extends Mage_Payment_Model_Method_Abstract {
		protected $_code = "sppayment";
		
		public function validate() {
			parent::validate();
		}
	}

and the new block:

<?php

class Shoppingplus_Sppayment_Block_Form_Sppayment extends Mage_Payment_Block_Form {
	
	protected function _construct() {

		parent::_construct();
		$this->setTemplate('sppayment/form/sppayment.phtml');

	}
}

that template is not loaded.

 

Thanks a lot for any help!

Re: Custom Payment Method not showing on checkout

define $_formBlockType and $_infoBlockType in your payment model and point to payment blocks

Re: Custom Payment Method not showing on checkout

Hi @giorg

 

I think these article can help you out:

  1. http://inchoo.net/magento/how-to-create-magento-payment-module/
  2. http://code.tutsplus.com/tutorials/create-a-custom-payment-method-module-in-magento-part-one--cms-23...
Found something useful, please give "Kudos" or "Accept as Solution" for Token of Appreciation.
Free Magento Extensions : https://magecomp.com/free-magento-extensions.html

Re: Custom Payment Method not showing on checkout

that did the trick, thanks a lot!

Re: Custom Payment Method not showing on checkout

is this Magento 1.x or Magento 2.0?

Re: Custom Payment Method not showing on checkout

It is for magento 1