checkout

Make checkout country dropdown readonly in Woocommerce

坚强是说给别人听的谎言 提交于 2021-02-04 15:54:04
问题 I want country dropdown on woocommerce as readonly. I already set the default country to australia but I want them to be readonly. 回答1: The answer of Kashalo is correct… You can also use one of this multiple other ways: 1) For Checkout Billing country only: add_filter('woocommerce_checkout_fields', 'readdonly_billing_country_select_field'); function readdonly_billing_country_select_field( $fields ) { // Set billing and shipping country to AU WC()->customer->set_billing_country('AU'); // Make

Order custom fields not displayed on WooCommerce email notifications

烂漫一生 提交于 2021-02-04 08:13:03
问题 I wrote a little plugin that adds a couple of custom fields on checkout page. The fields are related to B2B buyers so they can input Company name, license number and address. Everything pretty much works fine, except the values are not being displayed in order emails, most importantly, order completed email. Here is the part of code I'm having trouble with add_filter('woocommerce_email_order_meta_fields', 'mx_woocommerce_email_order_meta_fields'); function mx_woocommerce_email_order_meta

Add radio buttons to specific shipping method on WooCommerce checkout

旧巷老猫 提交于 2021-02-04 08:10:28
问题 I added a new shipping method "pickup from store" with free shipping to WooCommerce. I have 2 stores, "Barsha" and "Deira". I would like when customer choose pickup from a store to be able to select which store he will visit. Here is what I added to cart-shipping.php template file: <?php <hr><p>Please choose the pickup store:</p> <input type="radio" id="barsha" sname="store" value="barsha"> <label for="barsha">Barsha<a href=""> Check Location</a></label><br> <input type="radio" id="deira"

Paypal Checkout - Payment always on pending

谁说胖子不能爱 提交于 2021-02-02 09:56:32
问题 Since three days i am trying to get the Paypal Checkout to work but i always have the problem that the order is created and the money in gone from the buying account but not reaching the payee account. So here is my setup: The Smart Buttons integeration in JavaScript: paypal.Buttons({ env: enviroment, // Set up the transaction createOrder: function() { let formData = new FormData(); formData.append('bookingId', bookingId); return fetch (url_createOrder, { method: 'POST', body: formData })

Paypal Checkout - Payment always on pending

依然范特西╮ 提交于 2021-02-02 09:54:20
问题 Since three days i am trying to get the Paypal Checkout to work but i always have the problem that the order is created and the money in gone from the buying account but not reaching the payee account. So here is my setup: The Smart Buttons integeration in JavaScript: paypal.Buttons({ env: enviroment, // Set up the transaction createOrder: function() { let formData = new FormData(); formData.append('bookingId', bookingId); return fetch (url_createOrder, { method: 'POST', body: formData })

Unhide Checkout Login form for unlogged users in Woocommerce

一曲冷凌霜 提交于 2021-01-29 04:35:31
问题 When a customer is not logged in, I want the Woocommerce login form to not be initially hidden on the checkout page. I would also like the create an account? Radio to be ticked like the subscribe button is by default. Thanks 回答1: The following hooked function will enable the login form by default for unlogged users // Enable the login form by default for unlogged users add_action( 'woocommerce_before_checkout_form', 'force_checkout_login_for_unlogged_customers', 4 ); function force_checkout

Display checkout field value in Woocommerce admin order list custom column

天涯浪子 提交于 2021-01-29 02:24:42
问题 I am stuck with a task. I would like to add an extra column to the shop order columns in woocommerce backend. This extra column should display an echo output if a customer checked a checkbox field on checkout. So to add the extra column it is not that hard. I did it this way. add_filter('manage_edit-shop_order_columns', 'invoice_order_overview'); function invoice_order_overview($columns) { $new_columns = (is_array($columns)) ? $columns : array(); unset($new_columns['order_actions']); //edit

Move coupon form before subtotal in WooCommerce checkout

牧云@^-^@ 提交于 2021-01-28 19:03:59
问题 In my Storefront child theme, in the checkout page, I am trying to move the coupon code block just above the cart totals and below the item review I see in review-order.php that there's the following hook just at the right place: do_action( 'woocommerce_review_order_after_cart_contents' ); So in the functions.php file, I added: remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 ); add_action( 'woocommerce_review_order_after_cart_contents', 'woocommerce

How to save from WooCommerce checkout a custom checkbox field state?

别等时光非礼了梦想. 提交于 2021-01-28 11:45:04
问题 I have a problem with the update_post_meta function. I have a user submitted value, which I pass via $_POST and then saving to post meta. All is working fine, but when the value is '0' the post meta is not updated. This is My code: // Add custom checkout field: woocommerce_review_order_before_submit add_action( 'woocommerce_after_order_notes', 'my_custom_checkout_field_ritiro_sede' ); function my_custom_checkout_field_ritiro_sede() { echo '<div class="cw_custom_class"><h3>'.__('Ritiro presso

Add a select field with time intervals based on opening, closing and breaks times in WooCommerce checkout

泪湿孤枕 提交于 2021-01-28 08:54:09
问题 I am building pizza delivery website with WooCommerce. In fact when customer is checking out, he can select when he want to have food delivered. The select box should contain 15 minute intervals ranging from the current time and clearing all past hours. The first option I want is to be "As soon as possible", and then the next option is an hour later (rounded to nearest 15mins), and then 15 mins each time. Our delivery hours are as below: Monday: Closed Tuesday - Friday 11:30 - 14:00 & 17:00 -