Note that there are some explanatory texts on larger screens.

plurals
  1. POPayment Method Module doesn't show in Store
    text
    copied!<p>Hi I developed a magento payment module, It shows in Admin area but not in Frontend Store Check out page.</p> <p>folder structure</p> <pre><code>app/local/Company/Cashondelivery/Block app/local/Company/Cashondelivery/Model app/local/Company/Cashondelivery/controller app/local/Company/Cashondelivery/etc app/local/Company/Cashondelivery/helpers </code></pre> <p>The etc/config.xml</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;modules&gt; &lt;Company_Cashondelivery&gt; &lt;!-- declare module's version information for database updates --&gt; &lt;version&gt;0.1.0&lt;/version&gt; &lt;/Company_Cashondelivery&gt; &lt;/modules&gt; &lt;global&gt; &lt;!-- declare model group for new module --&gt; &lt;models&gt; &lt;!-- model group alias to be used in Mage::getModel('newmodule/...') --&gt; &lt;cashondelivery&gt; &lt;!-- base class name for the model group --&gt; &lt;class&gt;Company_Cashondelivery_Createorder&lt;/class&gt; &lt;/cashondelivery&gt; &lt;/models&gt; &lt;helpers&gt; &lt;cashondelivery&gt; &lt;class&gt;Company_Cashondelivery_Helper&lt;/class&gt; &lt;/cashondelivery&gt; &lt;/helpers&gt; &lt;!-- declare resource setup for new module --&gt; &lt;resources&gt; &lt;!-- resource identifier --&gt; &lt;cashondelivery_setup&gt; &lt;!-- specify that this resource is a setup resource and used for upgrades --&gt; &lt;setup&gt; &lt;!-- which module to look for install/upgrade files in --&gt; &lt;module&gt;Company_Cashondelivery&lt;/module&gt; &lt;/setup&gt; &lt;!-- specify database connection for this resource --&gt; &lt;connection&gt; &lt;!-- do not create new connection, use predefined core setup connection --&gt; &lt;use&gt;core_setup&lt;/use&gt; &lt;/connection&gt; &lt;/cashondelivery_setup&gt; &lt;cashondelivery_write&gt; &lt;connection&gt; &lt;use&gt;core_write&lt;/use&gt; &lt;/connection&gt; &lt;/cashondelivery_write&gt; &lt;cashondelivery_read&gt; &lt;connection&gt; &lt;use&gt;core_read&lt;/use&gt; &lt;/connection&gt; &lt;/cashondelivery_read&gt; &lt;/resources&gt; &lt;/global&gt; &lt;!-- declare default configuration values for this module --&gt; &lt;default&gt; &lt;!-- 'payment' configuration section (tab) --&gt; &lt;payment&gt; &lt;!-- 'newmodule' configuration group (fieldset) --&gt; &lt;cashondelivery&gt; &lt;!-- by default this payment method is inactive --&gt; &lt;active&gt;1&lt;/active&gt; &lt;!-- model to handle logic for this payment method --&gt; &lt;model&gt;cashondelivery/createorder&lt;/model&gt; &lt;!-- order status for new orders paid by this payment method --&gt; &lt;order_status&gt;pending&lt;/order_status&gt; &lt;!-- default title for payment checkout page and order view page --&gt; &lt;title&gt;Company&lt;/title&gt; &lt;/cashondelivery&gt; &lt;/payment&gt; &lt;/default&gt; &lt;/config&gt; </code></pre> <p>etc/system.xml</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;sections&gt; &lt;payment&gt; &lt;groups&gt; &lt;cashondelivery translate="label" module="cashondelivery"&gt; &lt;!-- will have title 'New Module' --&gt; &lt;label&gt;Company Cash On delivery&lt;/label&gt; &lt;!-- position between other payment methods --&gt; &lt;sort_order&gt;670&lt;/sort_order&gt; &lt;!-- do not show this configuration options in store scope --&gt; &lt;show_in_default&gt;1&lt;/show_in_default&gt; &lt;show_in_website&gt;1&lt;/show_in_website&gt; &lt;show_in_store&gt;0&lt;/show_in_store&gt; &lt;fields&gt; &lt;!-- is this payment method active for the website? --&gt; &lt;active translate="label"&gt; &lt;!-- label for the field --&gt; &lt;label&gt;Enabled&lt;/label&gt; &lt;!-- input type for configuration value --&gt; &lt;frontend_type&gt;select&lt;/frontend_type&gt; &lt;!-- model to take the option values from --&gt; &lt;source_model&gt;adminhtml/system_config_source_yesno&lt;/source_model&gt; &lt;!-- field position --&gt; &lt;sort_order&gt;1&lt;/sort_order&gt; &lt;!-- do not show this field in store scope --&gt; &lt;show_in_default&gt;1&lt;/show_in_default&gt; &lt;show_in_website&gt;1&lt;/show_in_website&gt; &lt;show_in_store&gt;0&lt;/show_in_store&gt; &lt;/active&gt; &lt;order_status translate="label"&gt; &lt;label&gt;New order status&lt;/label&gt; &lt;frontend_type&gt;select&lt;/frontend_type&gt; &lt;source_model&gt;adminhtml/system_config_source_order_status_processing&lt;/source_model&gt; &lt;sort_order&gt;4&lt;/sort_order&gt; &lt;show_in_default&gt;1&lt;/show_in_default&gt; &lt;show_in_website&gt;1&lt;/show_in_website&gt; &lt;show_in_store&gt;0&lt;/show_in_store&gt; &lt;/order_status&gt; &lt;title translate="label"&gt; &lt;label&gt;Title&lt;/label&gt; &lt;frontend_type&gt;text&lt;/frontend_type&gt; &lt;sort_order&gt;2&lt;/sort_order&gt; &lt;show_in_default&gt;1&lt;/show_in_default&gt; &lt;show_in_website&gt;1&lt;/show_in_website&gt; &lt;show_in_store&gt;0&lt;/show_in_store&gt; &lt;/title&gt; &lt;/fields&gt; &lt;/cashondelivery&gt; &lt;/groups&gt; &lt;/payment&gt; &lt;/sections&gt; &lt;/config&gt; &lt;?php /** * Our test CC module adapter */ class Company_Cashondelivery_Model_Createorder extends Mage_Payment_Model_Method_Abstract { /** * unique internal payment method identifier * * @var string [a-z0-9_] */ protected $_code = 'newmodule'; /** * Here are examples of flags that will determine functionality availability * of this module to be used by frontend and backend. * * @see all flags and their defaults in Mage_Payment_Model_Method_Abstract * * It is possible to have a custom dynamic logic by overloading * public function can* for each flag respectively */ /** * Is this payment method a gateway (online auth/charge) ? */ protected $_isGateway = true; /** * Can authorize online? */ protected $_canAuthorize = true; /** * Can capture funds online? */ protected $_canCapture = false; /** * Can capture partial amounts online? */ protected $_canCapturePartial = false; /** * Can refund online? */ protected $_canRefund = false; /** * Can void transactions online? */ protected $_canVoid = true; /** * Can use this payment method in administration panel? */ protected $_canUseInternal = true; /** * Can show this payment method as an option on checkout payment page? */ protected $_canUseCheckout = true; /** * Is this payment method suitable for multi-shipping checkout? */ protected $_canUseForMultishipping = true; /** * Can save credit card information for future processing? */ protected $_canSaveCc = false; /** * Here you will need to implement authorize, capture and void public methods * * @see examples of transaction specific public methods such as * authorize, capture and void in Mage_Paygate_Model_Authorizenet */ } ?&gt; </code></pre> <p>app/etc/modules/Company_Cashondelivery.xml</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;modules&gt; &lt;Company_Cashondelivery&gt; &lt;active&gt;true&lt;/active&gt; &lt;codePool&gt;local&lt;/codePool&gt; &lt;/Company_Cashondelivery&gt; &lt;/modules&gt; &lt;depends&gt; &lt;Mage_Payment /&gt; &lt;/depends&gt; &lt;/config&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload