checkout

Conditionally unset checkout field in woocommerce

落爺英雄遲暮 提交于 2019-12-11 02:25:53
问题 How can I conditionally unset the other two fields from server side and remove the required validation from it? Here is how the form looks like: Here is the code: function bs_filter_checkout_fields($fields){ $fields['billing'] = array( 'add_type' => array( 'type' => 'radio', 'label' => __( 'Address Type' ), 'options' => array( 'house' => __( 'House' ), 'building' => __( 'Building' ), 'office' => __( 'Office' ) ), 'required' => true ), 'add_house_name' => array( 'type' => 'text', 'required' =>

Magento custom fields on checkout

你。 提交于 2019-12-11 02:19:54
问题 Is there any tutorial available for how do i add custom fields on front end check out step like PO number,Job name , customer comments etc as well as in admin->create->order. 回答1: My usual motto is to find (and buy if needed) a module that already has the functionality you seek. Especially when the life of this project involves version upgrades because then you can seek a pre-packaged solution from the provider. I regret every bit of custom code I have added to our Magento install. Because

PayPal HTML buttons broken for large shopping carts on new PayPal checkout

我的未来我决定 提交于 2019-12-11 02:11:52
问题 Been battling for weeks with a PayPal Payment Standard FORM problem. We have been running the same code for many years but noticed our larger invoices (with over 20 items) on them were hitting a white screen of death recently when submitting to PayPal. Testing in the Sandbox worked just fine as before. After searching everywhere I couldn't find anyone else with this exact problem but noticed if we took the invoice down from say 60 items to 7 items then the invoices seemed to go thru ok. Seems

Adding a hidden checkout field in WooCommerce?

人盡茶涼 提交于 2019-12-11 02:04:50
问题 I want to include a link to a profile of the current user who submitted a checkout form through WooCommerce. That is, to place automatically a current user’s author link like this in the hidden field: example.com/author/username I want to achieve this by adding a hidden field in checkout form. So to get a link I would write something likes this: <?php $currentUser = get_current_user_id(); $user = get_user_by( 'id', $currentUser ); $userUrl = get_bloginfo( 'home' ) . '/author/' . $user->user

Remove a checkout field if cart items are from some specific product categories

喜欢而已 提交于 2019-12-11 01:46:13
问题 I use WooCommerce Checkout Manager to add a custom field in my billing section, but I need to show this field only if I have some product from a specified category. The fields is required. I wrote this code : add_filter( 'woocommerce_checkout_fields' , 'wc_ninja_remove_checkout_field'); function wc_ninja_remove_checkout_field( $fields ) { $categories = array( 'prodotti-in-polvere-e-bustine', 'gel-e-creme', 'prodotti-in-capsule', 'prodotti-plantari', 'prodotti-liquidi', 'area-riservata' ); if

Avoid checkout for mixed backorder and normal items in Woocommerce

筅森魡賤 提交于 2019-12-11 01:18:55
问题 Is it possible to disable checkout if there is backorder item mixed with in stock items. The code so far is displaying message if there is mixed items in the cart, but they still can checkout the order. We are using Preorder plugin and on the settings, the preorder and onhand cant be mixed in cart. Below are settings of plugin. Prevent mixing products If you enable this option, the cart cannot contain Pre-Order products and regular products at the same time.(enabled) But it only work if there

Display a custom notice before all default notices in Woocommerce checkout page

不羁岁月 提交于 2019-12-11 00:32:09
问题 I use the following below code for show custom message to un-logged woocommerce users (visitors) in checkout page add_action('woocommerce_before_checkout_form', 'my_custom_message'); function my_custom_message() { if ( ! is_user_logged_in() ) { wc_print_notice( __('This is my custom message'), 'notice' ); } } top code recive this forum, from mr @loictheaztec my before question link below: Display a custom message for guest users in Woocommerce checkout page I would like to change woocommerce

Save custom checkout field value as user data on WooCommerce

自作多情 提交于 2019-12-10 23:01:46
问题 I've added a custom checkbox in the checkout page of my WooCommerce shop for the optional newsletter subscription: add_action( 'woocommerce_after_order_notes', 'add_checkout_newsletter_subscribe', 9 ); function add_checkout_newsletter_subscribe() { woocommerce_form_field( 'checkout_newsletter', array( 'type' => 'checkbox', 'class' => array('form-row checkout-newsletter-box'), 'label_class' => array('woocommerce-form__label woocommerce-form__label-for-checkbox checkbox'), 'input_class' =>

Make checkout fields required in Woocommerce checkout

青春壹個敷衍的年華 提交于 2019-12-10 19:56:50
问题 For some reason, all the fields in Billing Address are marked as optional - customers are leaving the billing address fields blank and then their payments are being rejected (by Square, who is our payment processor). I cannot find anywhere to make these fields required, and cannot figure out why they would be marked as optional in any case. Can someone point me in the right direction? UPDATE I've even tried the following: add_filter('woocommerce_billing_fields', 'force_billing_fields', 1000,

Woocommerce Checkout not Working with No CAPTCHA reCAPTCHA for WooCommerce Plugin

对着背影说爱祢 提交于 2019-12-10 19:13:15
问题 when i active 'No CAPTCHA reCAPTCHA for WooCommerce' plugin, so on checkout page of WooCommerce when customer checked the 'Create an account?' check-box and than Place Order, it does not work. the page just scroll on to the top and nothing action. any idea? Reagrds Faizan 回答1: The plugin is just written to protect the Woocommerce Registration and Login, not the Checkout Process. In order to protect the Checkout Process, I tweaked registration.php like this class WC_Ncr_Registration_Captcha