checkout

How to add a heading in between checkout fields of Woocommerce

岁酱吖の 提交于 2019-12-01 07:36:56
I am customizing the WooCommerce checkout page fields. I want to add a heading (text) in between the fields. I have reordered the fields like this add_filter('woocommerce_checkout_fields', 'ac_checkout_reorder_fields'); function ac_checkout_reorder_fields($fields) { $order = array( "billing_first_name", "billing_last_name", "billing_company", "billing_email", "billing_phone", "billing_address_1", "billing_address_2", "billing_postcode", "billing_country" ); foreach($order as $field) { $ordered_fields[$field] = $fields["billing"][$field]; } $fields["billing"] = $ordered_fields; return $fields;

How to add a heading in between checkout fields of Woocommerce

牧云@^-^@ 提交于 2019-12-01 04:25:48
问题 I am customizing the WooCommerce checkout page fields. I want to add a heading (text) in between the fields. I have reordered the fields like this add_filter('woocommerce_checkout_fields', 'ac_checkout_reorder_fields'); function ac_checkout_reorder_fields($fields) { $order = array( "billing_first_name", "billing_last_name", "billing_company", "billing_email", "billing_phone", "billing_address_1", "billing_address_2", "billing_postcode", "billing_country" ); foreach($order as $field) {

Add a custom checkbox in WooCommerce checkout which value shows in admin edit order

…衆ロ難τιáo~ 提交于 2019-12-01 01:52:43
I try to add an <input type="checkbox"> which value also shows at the woocommerce backend, so I can see at the end if the costumer ticked the box or not. The checkbox should be below the Payment Methods. Is it possible to add a custom checkbox in WooCommerce checkout which value shows in admin edit order? You can do it in 3 steps: Adding the custom checkbox field below the Payment Methods Saving the custom checkbox field when it's checked in the order meta Displaying the custom checkbox field when it's checked on the order edit page Here is that code: // Add custom checkout field: woocommerce

Set a unique validation error notice in Woocommerce checkout page

◇◆丶佛笑我妖孽 提交于 2019-12-01 01:41:31
Woocommerce checkout page shows individual error if the required fields are empty. Normally, if all fields are empty, all errors for those empty fields will be shown: - First name is a required field - Last name is a required field - Street address is a required field - Town / City is a required field and so on… Is it possible to show only one error if all the required fields are empty? Like “ERROR: All fields are empty. Please fill in all required fields to place order.” How to achieve this? Checkout page To set a unique validation error notice in Woocommerce checkout page you will use the

Set minimum allowed weight for a specific country in WooCommerce

这一生的挚爱 提交于 2019-12-01 01:02:50
I am trying to specifically apply a mandatory minimum weight of 20 kilos for the country of Colombia avoiding checkout if the total cart weight is under this minimal weight. Here is my actual code, that allow me to fix a minimum weight: add_action( 'woocommerce_check_cart_items', 'cldws_set_weight_requirements' ); function cldws_set_weight_requirements() { // Only run in the Cart or Checkout pages if( is_cart() || is_checkout() ) { global $woocommerce; // Set the minimum weight before checking out $minimum_weight = 30; // Get the Cart's content total weight $cart_contents_weight = WC()->cart-

Add a new custom checkout field before billing details in Woocommerce?

北城余情 提交于 2019-12-01 00:39:48
I can add a set of custom fields to my WooCommerce checkout screen but need to move it above the 'Billing Details'. How can that be done? According to this official WooCommerce documentation , here is an example code to add extra custom checkout fields: /** * Add the field to the checkout */ add_action( 'woocommerce_after_order_notes', 'my_custom_checkout_field' ); function my_custom_checkout_field( $checkout ) { echo '<div id="my_custom_checkout_field"><h2>' . __('My Field') . '</h2>'; woocommerce_form_field( 'my_field_name', array( 'type' => 'text', 'class' => array('my-field-class form-row

Add text to order summary based on a custom field value in WooCommerce

烈酒焚心 提交于 2019-12-01 00:37:18
I have added successfully a custom field to my WooCommerce checkout page that is a selector for different stores that the customer can choose to collect their items from. At the moment it is showing this field on the checkout page and I am using jQuery to add information below the selector and updating the shipping cost accordingly. What I need to do next is to add the field + additional info about each pickup location on the customer's order email. so for instance if the customer selects location 1 the order email should show: Delivery location = Location 1 Address = 123 street Info = Pickup

WooCommerce - Checkout conditional fields for different persons custom status

萝らか妹 提交于 2019-12-01 00:05:18
I need to modify the checkout process for an woocommere website. The process is determinated by the status of the person that could be one of this: - 'legal entity' - 'individual' I need to have a selector 'User status' (or radio buttons) , just after the 'billing_first_name' and 'billing_last_name'. The selector should work this way: If 'legal entity' is selected, it should display 3 fields: 'phone_number' 'email' 'serial_id' If 'individual' is selected, it should display 3 other fields: 'custom_field1' 'custom_field2' 'custom_field3' I tried WooCommerce Checkout Manager and another plugin

git checkout 检出命令

被刻印的时光 ゝ 提交于 2019-11-30 22:03:07
检出命令(git checkout) 是git最常用的命令之一,同时也是个很危险的命令,因为这条命令会重写工作区: 用法一:git checkout [-q] [<commit>] [--] <paths>... 用法二:git checkout [<branch>] 用法三:git checkout [-m] [[-b|--orphan] <new_branch>] [<start_point>] 上面列出的第一种用法和第二种用法的区别在于,第一种用法在命令中包含路径<paths>.为了避免路径和引用(或者提交id)同名而发生冲突,可以在<paths>前面用两个连续的短线(减号作为分割) 第一种用法的<commit>是可选项,如果省略则相当于从暂存区进行检出(检出的默认值是暂存区)。 第一种用法(包含了路径<paths>的用法)不会改变HEAD头指针,主要是用于指定版本的文件覆盖工作区中对应的文件。 如果省略<commit>,则会用暂存区的文件覆盖工作区的文件,否则用指定提交中的文件覆盖暂存区和工作区中对应的文件. 第二种用法则会改变HEAD头指针,主要用作切换到分支,如果省略<branch>则相当于对工作区进行状态检查。 第三种用法主要是创建和切换到新的分支(<new_branch>),新的分支从<start_point>指定的提交开始创建

Set a unique validation error notice in Woocommerce checkout page

僤鯓⒐⒋嵵緔 提交于 2019-11-30 20:25:43
问题 Woocommerce checkout page shows individual error if the required fields are empty. Normally, if all fields are empty, all errors for those empty fields will be shown: - First name is a required field - Last name is a required field - Street address is a required field - Town / City is a required field and so on… Is it possible to show only one error if all the required fields are empty? Like “ERROR: All fields are empty. Please fill in all required fields to place order.” How to achieve this?