Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/246.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 付款方式模块不支持';店内不展示_Php_Zend Framework_Magento - Fatal编程技术网

Php 付款方式模块不支持';店内不展示

Php 付款方式模块不支持';店内不展示,php,zend-framework,magento,Php,Zend Framework,Magento,您好,我开发了一个magento支付模块,它显示在管理区,但不在前端商店结账页面 文件夹结构 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 et

您好,我开发了一个magento支付模块,它显示在管理区,但不在前端商店结账页面

文件夹结构

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
etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
       <Company_Cashondelivery>
<!-- declare module's version information for database updates -->
          <version>0.1.0</version>
       </Company_Cashondelivery>
    </modules>
    <global>
<!-- declare model group for new module -->
        <models>
<!-- model group alias to be used in Mage::getModel('newmodule/...') -->
            <cashondelivery>
<!-- base class name for the model group -->
                <class>Company_Cashondelivery_Createorder</class>
            </cashondelivery>    
        </models>
        <helpers>
            <cashondelivery>
                <class>Company_Cashondelivery_Helper</class>
            </cashondelivery>
        </helpers> 
<!-- declare resource setup for new module -->
        <resources>
<!-- resource identifier -->
            <cashondelivery_setup>
<!-- specify that this resource is a setup resource and used for upgrades -->
                <setup>
<!-- which module to look for install/upgrade files in -->
                    <module>Company_Cashondelivery</module>
                </setup>
<!-- specify database connection for this resource -->
                <connection>
<!-- do not create new connection, use predefined core setup connection -->
                    <use>core_setup</use>
                </connection>
            </cashondelivery_setup>
            <cashondelivery_write>
                <connection>
                  <use>core_write</use>
                </connection>
            </cashondelivery_write>
            <cashondelivery_read>
               <connection>
                <use>core_read</use>
              </connection>
            </cashondelivery_read>
        </resources>
    </global>

<!-- declare default configuration values for this module -->
    <default>
<!-- 'payment' configuration section (tab) -->
        <payment>
<!-- 'newmodule' configuration group (fieldset) -->
            <cashondelivery>
<!-- by default this payment method is inactive -->
                <active>1</active>
<!-- model to handle logic for this payment method -->
                <model>cashondelivery/createorder</model>
<!-- order status for new orders paid by this payment method -->
                <order_status>pending</order_status>
<!-- default title for payment checkout page and order view page -->
                <title>Company</title>                
            </cashondelivery>
         </payment>
    </default>
</config>
<models>
<!-- model group alias to be used in Mage::getModel('newmodule/...') -->
  <cashondelivery>
    <!-- base class name for the model group -->
    <class>Company_Cashondelivery_Createorder</class>
   </cashondelivery>    
 </models>

0.1.0
公司\现金交付\创建订单
公司\现金交付\助手
公司现金交付
核心单元设置
核心写入
核心读取
1.
现金交付/创建订单
悬而未决的
单位
etc/system.xml

<?xml version="1.0"?>
<config>
   <sections>
        <payment>
            <groups>
                <cashondelivery translate="label" module="cashondelivery">
                    <!-- will have title 'New Module' -->
                    <label>Company 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_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>
                        <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>
                </cashondelivery>
            </groups>
        </payment>
    </sections>
</config>


<?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
     */


}
?>

公司货到付款
670
1.
1.
0
启用
选择
adminhtml/system\u config\u source\u yesno
1.
1.
1.
0
新订单状态
选择
adminhtml/system\u config\u source\u order\u status\u processing
4.
1.
1.
0
标题
文本
2.
1.
1.
0
app/etc/modules/Company_Cashondelivery.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Company_Cashondelivery>
            <active>true</active>
            <codePool>local</codePool>
         </Company_Cashondelivery>
    </modules>
    <depends> 
        <Mage_Payment /> 
    </depends> 
</config>

真的
地方的

在config.xml中找到了您的问题

<?xml version="1.0"?>
<config>
    <modules>
       <Company_Cashondelivery>
<!-- declare module's version information for database updates -->
          <version>0.1.0</version>
       </Company_Cashondelivery>
    </modules>
    <global>
<!-- declare model group for new module -->
        <models>
<!-- model group alias to be used in Mage::getModel('newmodule/...') -->
            <cashondelivery>
<!-- base class name for the model group -->
                <class>Company_Cashondelivery_Createorder</class>
            </cashondelivery>    
        </models>
        <helpers>
            <cashondelivery>
                <class>Company_Cashondelivery_Helper</class>
            </cashondelivery>
        </helpers> 
<!-- declare resource setup for new module -->
        <resources>
<!-- resource identifier -->
            <cashondelivery_setup>
<!-- specify that this resource is a setup resource and used for upgrades -->
                <setup>
<!-- which module to look for install/upgrade files in -->
                    <module>Company_Cashondelivery</module>
                </setup>
<!-- specify database connection for this resource -->
                <connection>
<!-- do not create new connection, use predefined core setup connection -->
                    <use>core_setup</use>
                </connection>
            </cashondelivery_setup>
            <cashondelivery_write>
                <connection>
                  <use>core_write</use>
                </connection>
            </cashondelivery_write>
            <cashondelivery_read>
               <connection>
                <use>core_read</use>
              </connection>
            </cashondelivery_read>
        </resources>
    </global>

<!-- declare default configuration values for this module -->
    <default>
<!-- 'payment' configuration section (tab) -->
        <payment>
<!-- 'newmodule' configuration group (fieldset) -->
            <cashondelivery>
<!-- by default this payment method is inactive -->
                <active>1</active>
<!-- model to handle logic for this payment method -->
                <model>cashondelivery/createorder</model>
<!-- order status for new orders paid by this payment method -->
                <order_status>pending</order_status>
<!-- default title for payment checkout page and order view page -->
                <title>Company</title>                
            </cashondelivery>
         </payment>
    </default>
</config>
<models>
<!-- model group alias to be used in Mage::getModel('newmodule/...') -->
  <cashondelivery>
    <!-- base class name for the model group -->
    <class>Company_Cashondelivery_Createorder</class>
   </cashondelivery>    
 </models>

公司\现金交付\创建订单
将其更改为:

<models>
<!-- model group alias to be used in Mage::getModel('newmodule/...') -->
  <cashondelivery>
    <!-- base class name for the model group -->
    <class>Company_Cashondelivery_Model</class>
   </cashondelivery>    
 </models>

公司\现金交付\模式

公司现金交付模式是主要问题

在config.xml中找到了您的问题

<?xml version="1.0"?>
<config>
    <modules>
       <Company_Cashondelivery>
<!-- declare module's version information for database updates -->
          <version>0.1.0</version>
       </Company_Cashondelivery>
    </modules>
    <global>
<!-- declare model group for new module -->
        <models>
<!-- model group alias to be used in Mage::getModel('newmodule/...') -->
            <cashondelivery>
<!-- base class name for the model group -->
                <class>Company_Cashondelivery_Createorder</class>
            </cashondelivery>    
        </models>
        <helpers>
            <cashondelivery>
                <class>Company_Cashondelivery_Helper</class>
            </cashondelivery>
        </helpers> 
<!-- declare resource setup for new module -->
        <resources>
<!-- resource identifier -->
            <cashondelivery_setup>
<!-- specify that this resource is a setup resource and used for upgrades -->
                <setup>
<!-- which module to look for install/upgrade files in -->
                    <module>Company_Cashondelivery</module>
                </setup>
<!-- specify database connection for this resource -->
                <connection>
<!-- do not create new connection, use predefined core setup connection -->
                    <use>core_setup</use>
                </connection>
            </cashondelivery_setup>
            <cashondelivery_write>
                <connection>
                  <use>core_write</use>
                </connection>
            </cashondelivery_write>
            <cashondelivery_read>
               <connection>
                <use>core_read</use>
              </connection>
            </cashondelivery_read>
        </resources>
    </global>

<!-- declare default configuration values for this module -->
    <default>
<!-- 'payment' configuration section (tab) -->
        <payment>
<!-- 'newmodule' configuration group (fieldset) -->
            <cashondelivery>
<!-- by default this payment method is inactive -->
                <active>1</active>
<!-- model to handle logic for this payment method -->
                <model>cashondelivery/createorder</model>
<!-- order status for new orders paid by this payment method -->
                <order_status>pending</order_status>
<!-- default title for payment checkout page and order view page -->
                <title>Company</title>                
            </cashondelivery>
         </payment>
    </default>
</config>
<models>
<!-- model group alias to be used in Mage::getModel('newmodule/...') -->
  <cashondelivery>
    <!-- base class name for the model group -->
    <class>Company_Cashondelivery_Createorder</class>
   </cashondelivery>    
 </models>

公司\现金交付\创建订单
将其更改为:

<models>
<!-- model group alias to be used in Mage::getModel('newmodule/...') -->
  <cashondelivery>
    <!-- base class name for the model group -->
    <class>Company_Cashondelivery_Model</class>
   </cashondelivery>    
 </models>

公司\现金交付\模式

公司现金交付模式是主要问题

系统->配置->支付方式->现金交付->启用->是
?并清除了缓存?已经尝试过了,但没有成功。
系统->配置->支付方式->现金交付->启用->是
?清理了储藏室?已经试过了,但是没有成功。