如何解决从单选按钮获取选择以保存和工作
下午好,我们创建了一个“是”或“否”单选按钮,如果从单选按钮中选择了“是”,则需要分配以下内容(我们在第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>
<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";
以下是添加上述代码之前的原始文件链接):
任何帮助将不胜感激。
问候,
安迪
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。