打开车 - 在结帐页面接收无线电价值 [英] Open Cart - Receiving radio value at checkout page

查看:198
本文介绍了打开车 - 在结帐页面接收无线电价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助结帐时创建一个单选框。
我不知道如何有单选框的结果与我在结账页面的其他信息,如帐单地址等等。

I need help to create a radio box during the checkout. I have no idea how to have the result of the radio box send along with my other information in the checkout page such as billing address and many more.

这是我做什么,
    
    
    

<input type="radio" name="shipping_address" value="existing" id="shipping-address-existing" checked="checked" class="radio inline" />
<b><?php echo $text_delivery2; ?></b>

<input type="radio" name="shipping_address" value="existing" id="shipping-address-existing" checked="checked" class="radio inline" />
<b><?php echo $text_delivery3; ?></b>
</label>

,但没有显示出什么。
谢谢

but there is nothing shown. thanks

推荐答案

首先是对问题specic因为结帐页面包含各种节(登录,注册,付款地址,付款方式,送货地址,送货方式沿条件列表,快速确认等)

First be specic on question because the checkout page contains list of conditions along with various section (login,register,payment address, payment method, shipping address, shipping method, quick confirm etc)

有行动的名单和他们有关的模板,所以你需要在有关文件中的变化,假设你是在帐单地址添加单选按钮

There are list of action and their regarding template, So you need to change in the regarding file, Suppose you are adding radio button on billing address

找到有关模板文件,并添加无线

Find regarding template file and add radio

//template>checkout>payment_address.tpl 
<input type="radio" name="shipping_address" value="existing1" id="shipping-address-existing" checked="checked" class="radio inline" />
<b><?php echo 'Delivery2'; ?></b>

<input type="radio" name="shipping_address" value="existing2" id="shipping-address-existing" checked="checked" class="radio inline" />
<b><?php echo 'Delivery3'; ?></b>
</label>

现在在结帐页面就可以看到你的单选按钮,它使用AJAX方法来解析数据功能

Now in checkout page you can see your radio buttons, It uses the ajax method to parse data to function

//in line 350 of template>checkout>checkout.tpl 

您可以看到一个AJAX功能函数

you can see a ajax function function

$('#button-payment-address').live('click', function() {
    $.ajax({
        url: 'index.php?route=checkout/payment_address/validate',
        type: 'post',
        data: $('#payment-address input[type=\'text\'], #payment-address input[type=\'password\'], #payment-address input[type=\'checkbox\']:checked, #payment-address input[type=\'radio\']:checked, #payment-address input[type=\'hidden\'], #payment-address select'),
        dataType: 'json',

下面的网址重新preesnts控制器功能

Here the url repreesnts the controller function

// controller>checkout>payment_address.php and function is validate()

在这里,您可以获取您的电台值 $ _ POST ['shipping_address'] 因为在阿贾克斯
我们定义键入:后

希望这有助于

这篇关于打开车 - 在结帐页面接收无线电价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆