You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在WordPress的Contact Form 7中通过PayPal和Stripe插件设置双支付价格

搞定CF7下拉菜单价格联动支付的设置

嘿,我帮你梳理一下怎么让下拉菜单选的价格自动关联到PayPal和Stripe支付里,步骤很清晰,跟着做就行:

第一步:修改CF7的价格下拉字段

你原来的价格下拉是把显示文本和价格混在一起的,支付插件没法直接识别数字,所以得把选项改成「显示文本|实际价格值」的格式,这样CF7能把纯数字价格传递给支付插件。修改后的代码如下:

<div class="column one-second">
  <p class="big">Options</p>
  [select* price-option include_blank "20 invitations|100" "40 invitations|170"]
</div> 
<div class="column one-second">
  <p class="big">Your Contact Email:</p>
  [email* your-email placeholder "Your e-mail"] 
</div> 
<div class="column one">
  <p class="big">A description of your targeted membership candidates: </p>
  [textarea background-experience x5 placeholder "A description of your targeted membership candidates:"]
</div> 
<div class="column one-second">
  Pay $100 or $170 [select* group-recruitment "Pay with PayPal|paypal" "Pay with Credit Card|stripe"]
</div> 
<div class="column one">
  [submit class:button_full_width "Submit your Article"]
</div>

我加了include_blank是为了强制用户选择一个价格选项,避免空值提交,你如果不需要可以删掉。

第二步:配置CF7 PayPal插件

打开你的CF7表单设置页面,找到「PayPal」标签页:

  • 在「Amount Field」(金额字段)里输入price-option,这会告诉插件从这个下拉字段里读取支付金额。
  • 其他常规配置(比如收款邮箱、货币类型)保持你原来的设置就行。

第三步:配置CF7 Stripe插件

同样在CF7表单设置里找到「Stripe」标签页:

  • 找到「Amount」相关的设置项,选择「Use a field value」,然后指定字段名为price-option。
  • 确认货币设置和你价格的货币一致(这里是USD)。

第四步:处理支付方式切换(可选但推荐)

因为你有一个支付方式的下拉菜单,最好确保用户选PayPal时走PayPal流程,选Stripe时走Stripe流程。大部分CF7支付插件都支持这种条件触发:

  • 找到插件里的「Conditional Logic」(条件逻辑)设置,添加规则:当group-recruitment的值为paypal时,启用PayPal支付;当值为stripe时,启用Stripe支付。
  • 这样用户提交表单时,只会触发他们选择的支付方式,避免冲突。

做完这些设置后,测试一下表单:选择不同的价格,提交后看看支付页面显示的金额是不是对应你选的选项,没问题就大功告成啦!

内容的提问来源于stack exchange,提问作者Paul Anigbo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 06:28:03