checkout

Add dropdown list of cities in Woocommerce checkout page

天大地大妈咪最大 提交于 2020-07-03 00:50:09
问题 I want to add specific cities list in dropdown in checkout page of Woocommerce. Any best solution to add a dropdown of specific cities. I want to add dropdown on this website http://www.pkbrand.com 回答1: It can be done using a custom function hooked in woocommerce_checkout_fields action hook, where you will define in an array your desired cities: // Change "city" checkout billing and shipping fields to a dropdown add_filter( 'woocommerce_checkout_fields' , 'override_checkout_city_fields' );

Display minimum weight and remaining weight message on cart and checkout page for specific category - WooCommerce

你离开我真会死。 提交于 2020-06-28 06:10:20
问题 Inspired from Minimum cart amount for specific product categories in WooCommerce I have the following code , I would have liked it applied to the category (slug: special-box) and hide the "proceed to check out button" until the minimum is reached. add_action( 'woocommerce_check_cart_items', 'checkout_required_min_weight_mood' ); function checkout_required_min_weight_mood () { // soltanto sulle pagine carrello e check out if( ! ( is_cart() || is_checkout() ) ) return; // qui il minimo del peso

Remove standard css classes of checkout field wrappers in Woocommerce

久未见 提交于 2020-06-26 05:10:42
问题 I'm building an eCommerce website based on Wordpress and Woocommerce. So far everything is going great, but on the last page of the chec-out (billing and shipping), the standard classes of Woocommerce are interfering with the markup of Bootstrap 4. Every field in the billing form is wrapped by a tag with at least the class form-row (i.e.): class="form-row form-row-first" This causes the forms to '"fall" of of the standard BS grid. Anyone knows how to remove these wrapper classes? Thanks a

Remove standard css classes of checkout field wrappers in Woocommerce

依然范特西╮ 提交于 2020-06-26 05:10:19
问题 I'm building an eCommerce website based on Wordpress and Woocommerce. So far everything is going great, but on the last page of the chec-out (billing and shipping), the standard classes of Woocommerce are interfering with the markup of Bootstrap 4. Every field in the billing form is wrapped by a tag with at least the class form-row (i.e.): class="form-row form-row-first" This causes the forms to '"fall" of of the standard BS grid. Anyone knows how to remove these wrapper classes? Thanks a

Custom placeholder for all WooCommerce checkout fields

▼魔方 西西 提交于 2020-06-25 03:29:10
问题 I am trying to add a placeholder to my WooCommerce checkout fields, and it's working perfectly for every field except for the phone and the email fields. This is the code I am using: add_filter('woocommerce_default_address_fields', 'override_address_fields'); function override_address_fields( $address_fields ) { $address_fields['first_name']['placeholder'] = 'Fornavn'; $address_fields['last_name']['placeholder'] = 'Efternavn'; $address_fields['address_1']['placeholder'] = 'Adresse'; $address

Woocommerce conditional checkout fields and Eu VAT based on country and cart total

随声附和 提交于 2020-06-17 09:52:25
问题 In woocommerce I have enabled Woocommerce EU VAT plugin and created a required custom checkout select field "Customer type" with 2 choices: Individual Business Now I am trying to show and enable EU VAT field for: Orders amount up to 500 only 'customer_type' for 'business' only, Countries: Denmark and Finland only. Here is my code: add_filter('woocommerce_checkout_fields', 'add_eu_vat_to_checkout'); function add_eu_vat_to_checkout() { if ( is_admin() && ! defined( 'DOING_AJAX' ) || ! is

Conditional custom checkout fields based on product category in Woocommerce

主宰稳场 提交于 2020-06-15 06:42:49
问题 I am using woocommerce for a site for a nonprofit that sells tickets to classes and tickets to events. When someone is signing up for a class then need to list their emergency contact information and agree to a liability release. When they are buying a ticket to an event the nonprofit doesn't need the emergency contact info or the liability release. So... they want those fields to appear on the woocommerce checkout only on the condition that the person is checking out with a ticket for a

WooCommerce: Pre-select and restrict to one state and city on checkout

你离开我真会死。 提交于 2020-06-10 04:09:49
问题 I'm setting up a store that only sells to one city. I'm trying to figure out how I can restrict the city option to a pre-filled field. I've already limited the country and using the following code in my functions.php : add_filter( 'default_checkout_country', 'change_default_checkout_country' ); add_filter( 'default_checkout_state', 'change_default_checkout_state' ); function change_default_checkout_country() { return 'PK'; // country code } function change_default_checkout_state() { return

WooCommerce: Pre-select and restrict to one state and city on checkout

落花浮王杯 提交于 2020-06-10 04:09:11
问题 I'm setting up a store that only sells to one city. I'm trying to figure out how I can restrict the city option to a pre-filled field. I've already limited the country and using the following code in my functions.php : add_filter( 'default_checkout_country', 'change_default_checkout_country' ); add_filter( 'default_checkout_state', 'change_default_checkout_state' ); function change_default_checkout_country() { return 'PK'; // country code } function change_default_checkout_state() { return

Set a minimum order amount in WooCommerce

北慕城南 提交于 2020-05-23 07:22:51
问题 I want to have a minimum order amount in my WooCommerce store. The following code is perfectly showing a notice if the amount isn't reached but the checkout is still possible. How to disable checkout-button when the minimum amount isn't reached? add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' ); add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' ); function wc_minimum_order_amount() { // Set this variable to specify a minimum order value $minimum = 50; if