从单选按钮获取选择以保存和工作

问题描述

下午好,我们创建了一个“是”或“否”单选按钮,如果从单选按钮中选择了“是”,则需要分配以下内容(我们在第129行中添加了以下付款操作代码)。如果选择否,则不应执行此操作。我们还需要能够保存是或否选择,以实现选择。 'paymentaction'=>'authorization',在以下PHP变量下 $ paypal_vars + =数组(

我们需要在其中包含的代码如下:

$authorisation_or_completed_payment = get_option( 'authorisation_or_completed_payment' );
$authorisation_or_completed_payment1 = "";
$authorisation_or_completed_payment2 = "";
switch( $authorisation_or_completed_payment ) {
    case 1:
        $authorisation_or_completed_payment1 = "checked='checked'";
        break;

    case 0:
        default:
        $authorisation_or_completed_payment2 = "checked='checked'";
        break;
}
$output .= "

下面的单选按钮代码

" . __( 'Payment Authorisations:','wp-e-commerce' ) . "
    </td>
    <td>
        <input type='radio' value='1' name='authorisation_or_completed_payment' id='authorisation_or_completed_payment1' " . $authorisation_or_completed_payment1 . " /> <label for='authorisation_or_completed_payment1'>" . __( 'Yes','wp-e-commerce' ) . "</label> &nbsp;
        <input type='radio' value='0' name='authorisation_or_completed_payment' id='authorisation_or_completed_payment2' " . $authorisation_or_completed_payment2 . " /> <label for='authorisation_or_completed_payment2'>" . __( 'No','wp-e-commerce' ) . "</label>
        <p class='description'>
            " . __( "This setting allows you to choose if you with to have PayPal payments come through as authorisations,or completed payments. Tick yes for payments to come through as authorisations,or no for payments to come through as completed payments. If set to authorisations,you will then be able to capture or void the transaction from within your PayPal account.",'wp-e-commerce' ) . "
        </p>
    </td>
</tr>\n";

以下是添加上述代码之前的原始文件链接):

https://github.com/wp-e-commerce/WP-e-Commerce/blob/branch-3.15.1/wpsc-merchants/paypal-standard.merchant.php

任何帮助将不胜感激。

问候,

安迪

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)