Woocommerce 结帐页面先显示送货地址,然后显示帐单地址? [英] Woocommerce checkout page show shipping address first then billing address?

查看:28
本文介绍了Woocommerce 结帐页面先显示送货地址,然后显示帐单地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Woocommerce 的结帐页面中,我需要更改地址的功能意味着首先我需要送货地址字段,然后是帐单地址字段.

如果选中复选框如下所示,则首先显示帐单,然后显示运费.

<块引用>

账单地址在前

现在我需要更改它,例如当我选中复选框时首先显示送货地址,它会显示我的帐单地址.见下图.

<块引用>

送货地址优先

我需要在不更改主题文件夹中的任何woocommerce文件的情况下进行此更改,还需要验证和jquery效果.

有人可以帮我做吗??

提前致谢

代码片段:这不是解决方案,所以请不要写这个,因为它改变了位置而不是功能和复选框.请看我发布的截图.

<块引用>

账单地址在前

<?php do_action( 'woocommerce_checkout_billing' );?><?php do_action('woocommerce_checkout_shipping');?>

<块引用>

送货地址优先

<?php do_action( 'woocommerce_checkout_shipping' );?><?php do_action('woocommerce_checkout_billing');?>

这个问题仍然没有解决,jquery 不是很好的解决方案,因为结帐也作为 ajax 和验证运行.如果有人有好的解决方案,请提供,以便其他人可以从这里提供帮助.

解决方案

如果您正在使用子主题,那么它可以轻松完成.

步骤:

1) 从 wp-content->plugins->woocommerce->templates->checkout 复制 form-checkout.php 并将其粘贴到 <代码>wp-content\themes\your_theme\woocommerce\myaccount.

2) 改变这个

<div class="col-1"><?php do_action('woocommerce_checkout_billing');?>

<div class="col-2"><?php do_action('woocommerce_checkout_shipping');?>

<div class="col-1"><?php do_action('woocommerce_checkout_shipping');?>

<div class="col-2"><?php do_action('woocommerce_checkout_billing');?>

注意:此解决方案仅适用于子主题.

In checkout page of Woocommerce i need to change functionality of address means first i need shipping address fields then billing address fields.

Billing is shown first and then shipping shown if checkbox checked like below here see image.

Billing address first

now i need to change it like shipping address show first when i check check box it show me billing address. see below image.

Shipping address first

i need this change without changing any woocommerce file means in theme folder also validation and jquery effect is also needed.

can any one plz help me to make it??

advance thanks

code snippets: this is not solution so plz do not write this because it change place not functionality and check box. plz see screenshot that i post.

Billing address first

<?php do_action( 'woocommerce_checkout_billing' ); ?>
<?php do_action( 'woocommerce_checkout_shipping' ); ?>

Shipping address first

<?php do_action( 'woocommerce_checkout_shipping' ); ?>
<?php do_action( 'woocommerce_checkout_billing' ); ?>

still this question is unsolved, jquery is not good solution for this because checkout run as ajax and validation also. if any one have good solution then provide so other can help from here.

解决方案

If you are using child theme then it could be done easily.

STEPS:

1) Copy form-checkout.php from wp-content->plugins->woocommerce->templates->checkout and paste it inside wp-content\themes\your_theme\woocommerce\myaccount.

2) Change this

<div class="col2-set" id="customer_details">
     <div class="col-1">
          <?php do_action( 'woocommerce_checkout_billing' ); ?>
     </div>

      <div class="col-2">
           <?php do_action( 'woocommerce_checkout_shipping' ); ?>
       </div>
</div>

to

<div class="col2-set" id="customer_details">
     <div class="col-1">
          <?php do_action( 'woocommerce_checkout_shipping' ); ?>    
     </div>

      <div class="col-2">
           <?php do_action( 'woocommerce_checkout_billing' ); ?>               
       </div>
</div>

NOTE: This solution works with only child theme.

这篇关于Woocommerce 结帐页面先显示送货地址,然后显示帐单地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
前端开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆