Magento - 付款方式现金没有发票(Mindstretch模块)

时间:2012-01-23 22:31:13

标签: magento payment

我们正在维护一个基于Magento的网上商店,其中包含从Mindstretch安装的支付模块。我们使用“货到付款”选项,但问题是模块在订单发送时会创建发票。但是,当选择“现金提取”时,它不应创建发票。这应该只在他们真正拿起它时才会发生。所以我们需要禁用发票的制作。问题是我不知道从哪里开始寻找。在config.xml和system.xml文件下面


CONFIG.XML:

<?xml version="1.0" encoding="UTF-8"?>
<config>

    <modules>
        <Mindstretch_Contant>
            <version>0.1.0</version>
        </Mindstretch_Contant>
    </modules>

    <global>
        <helpers>
                <contant>
                    <class>Mindstretch_Contant_Helper</class>
                </contant>
                <!--
                 <payment>
                    <rewrite>
                    <data>Mindstretch_Contant_Helper_Data</data>
                    </rewrite>
                </payment>
                -->
            </helpers>
        <models>
            <contant>
                <class>Mindstretch_Contant_Model</class>
            </contant>
        </models>
    <adminhtml>       
        <translate>
            <modules>
                <Mindstretch_Contant>
                    <files>
                        <default>Mindstretch_Backend.csv</default>
                    </files>
                </Mindstretch_Contant>
            </modules>
        </translate>
    </adminhtml>

        <resources>
            <contant_setup>
                <setup>
                    <module>Mindstretch_Contant</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </contant_setup>
            <contant_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </contant_write>
            <contant_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </contant_read>
        </resources>
    </global>

    <frontend>
        <routers>
            <contant>
                <use>standard</use>
                <args>
                    <module>Mindstretch_Contant</module>
                    <frontName>Contant</frontName>
                </args>
            </contant>
        </routers>
    </frontend>


    <default>
        <payment>
            <contant>

                <active>0</active>
                <model>contant/paymentLogic</model>
                <order_status>pending</order_status>
                <title>Contant</title>
                <api_key>46</api_key>
                <api_secret>46</api_secret>
                <payment_action>authorize_capture</payment_action>
                <allowspecific>0</allowspecific>
            </contant>
        </payment>
    </default>
</config>

的System.Xml:

<?xml version="1.0"?>
<config>
    <sections>

        <payment>
            <groups>

                <contant translate="label" module="paygate">
                    <label>Contant</label>
                    <sort_order>601</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>0</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>
                        <order_status translate="label">
                            <label>New order status</label>
                            <frontend_type>select</frontend_type>
                            <source_model>contant/paid</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>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>
                        </specificcountry>
                        <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>999</sort_order>
       <show_in_default>1</show_in_default>
       <show_in_website>1</show_in_website>
       <show_in_store>1</show_in_store>
      </sort_order>


                        <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>
                </contant>
            </groups>
        </payment>
    </sections>
</config>

PAYMENTLOGIC.PHP:

<?php
class Mindstretch_Contant_Model_PaymentLogic extends Mage_Payment_Model_Method_Abstract
{
    /**
     * Set forced canCreditmemo flag
     *
     * @param Varien_Event_Observer $observer
     * @return Mage_Payment_Model_Observer
     */
    protected $_code                    = 'contant';
    protected $_isGateway               = true;
    protected $_canAuthorize            = true;
    protected $_canCapture              = true;
    protected $_canCapturePartial       = false;
    protected $_canRefund               = true;
    protected $_canVoid                 = true;
    protected $_canUseInternal          = true;
    protected $_canUseCheckout          = true;
    protected $_canUseForMultishipping  = true;
    protected $_canSaveCc               = false;

    /*public function authorize (Varien_Object $payment, $amount)
    {

    }

    public function capture (Varien_Object $payment, $amount)
    {

    }

    public function refund (Varien_Object $payment, $amount)
    {

    }
    */
    public function void (Varien_Object $payment)
    {

    }

}
?>

希望有人可以给我一些指导方向。感谢

0 个答案:

没有答案