checkout

Show or Hide two checkout fields in Woocommerce

放肆的年华 提交于 2019-11-29 16:04:06
In Woocommerce checkout form im trying to hide billing_city and billing_address_1 fields first and after I fill the fields postcode and housenumber the other fields (address_1 and city) has to show. This is the script, but I does not work well and I dont know what I do wrong: ?> <script type="text/javascript"> jQuery('input#billing_housenumber').change(function(){ if (this.checked) { jQuery('#billing_city').fadeIn(); jQuery('#billing_city input').val(''); } else { jQuery('#billing_city').fadeOut(); } }); </script> <?php Any help is appreciated. Update 2 There is some errors, mistakes and

Remove attribute values from product variation title and show them on separate rows

爷,独闯天下 提交于 2019-11-29 15:01:19
I have a checkout page where I want to: Remove selected product attribute values from product variation title item. Remove the quantity from item title too. Display the different product attribute value such as size, color and the quantity on different rows, for this product variation item. I want to display on my checkout page: Aria Sport Shorts (the product title) Color: Dusty Pink Size: Small QTY: 1 Instead of this: Is it possible? Where I should start to make this real? UPDATED 1) Since WooCommerce 3+, to remove attribute values from Product variation title and to display them in a

Change cart and checkout button links on WooCommerce mini cart widget

孤人 提交于 2019-11-29 14:43:24
On Woocommerce, how can we change the URLs on "View cart" and "Checkout" links on the drop down menu that show up on hover over the shopping cart icon on the the home page? I have the "cart" and "checkout" pages setup but they are not linked to these. I can view these pages directly with urls. http://mysite/cart and http://mysite/checkout It seems that there is a problem somewhere with your theme (or in a plugin), as the minicart button links always point to the right cart and checkout pages. The minicart buttons are hooked in woocommerce_widget_shopping_cart_buttons action hook (in the cart

Not able to change checkout/cart.phtml through layout update

半世苍凉 提交于 2019-11-29 12:45:54
I am trying to change checkout/cart.phtml through layout update in my module's layout file i.e. mymodule.xml <layout> <checkout_cart_index> <reference name="checkout.cart"> <action method="setCartTemplate"><value>mymodule/checkout/cart.phtml</value></action> </reference> </checkout_cart_index> </layout> But It is not working. Any clues? The method is setTemplate not setCartTemplate, like so: <layout> <checkout_cart_index> <reference name="checkout.cart"> <action method="setTemplate"><value>mymodule/checkout/cart.phtml</value></action> </reference> </checkout_cart_index> </layout> Ankita, What

Add Custom registration fields in WooCommerce and phone field validation issue

强颜欢笑 提交于 2019-11-29 12:45:50
Similar questions have been asked before and I tried all the solutions but for some reason they won't work for me. I have a mini Woocommerce registration field included in the footer of my site so that people can register easily. The phone field is required but I want to set a minimum length to it to reduce the number of people entering fake numbers. I have the following codes added to my functions.php, (I'm including all the notifications to the form so that you can understand better) the placeholder and everything works but I can't get the minimum length (set using "pattern" custom attribute

Additional field on checkout for specific payment gateway in Woocommerce

北城余情 提交于 2019-11-29 12:20:11
I have a custom Woocommerce payment gateway and I need to add additional field on the checkout when the payment is selected. Basically, when the users click the custom payment gateway a "select" field should appear and they have to choose something from the select field. I have attached a screenshot to represent better the idea of what I need to do. Unfortunately, I couldn't find any info about that in the Docs. The following code will append to the gateway description in checkout page, a custom text input field (here, in this example to BACS payment gateway) : // BACS payement gateway

WooCommerce - Skip cart page redirecting to checkout page

我与影子孤独终老i 提交于 2019-11-29 12:15:30
Our website is kohsamuitour.net . I have added custom code to skip the cart page on checkout, which works for all sales. This code: function wc_empty_cart_redirect_url() { return 'https://www.kohsamuitour.net/all-tours/'; } add_filter( 'woocommerce_return_to_shop_redirect', 'wc_empty_cart_redirect_url' ); Now that does the job, but we also have a possibility to check booking availability. That can be found on the pages of private charters, i.e. this one: https://www.kohsamuitour.net/tours/kia-ora-catamaran/ . Here the customer is being redirected to the cart, where I don't want that to happen

Remove shipping Flat Rate method for particular Category in WooCommerce 2.6 and 3+

人盡茶涼 提交于 2019-11-29 12:13:02
I need help in woocommerce shipping options, I want to hide flat rate for a particular product category, where I only want to show local delivery or local pickup options. For all others categories all options should work. I have try to do it with that code (added in function.php file of my theme): function cart_has_product_with_orange_cats() { global $woocommerce; $product_in_cart = false; // start of the loop that fetches the cart items foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) { $_product = $values['data']; $terms = get_the_terms( $_product->id, 'product_cat' );

woocommerce change price in checkout and cart page

放肆的年华 提交于 2019-11-29 11:38:01
With woocommerce, in my website I'd like to add in the cart page a select input where the user can select a value between two options, and depending on this value I will change the price. so far, I could get the total and change it using this : function action_woocommerce_before_cart_totals( ) { global $woocommerce; $woocommerce->cart->total = $woocommerce->cart->total*0.25; var_dump( $woocommerce->cart->total);}; The issue is that when I go to checkout page it doesn't take the total calculated in functions.php Thanks for helping me. You can use woocommerce_review_order_before_order_total hook

Set WooCommerce order status when order is created from processing to pending

拟墨画扇 提交于 2019-11-29 11:24:32
When a woocommerce order is created the status of the order is "processing". I need to change the default order-status to "pending". How can I achieve this? The default order status is set by the payment method or the payment gateway. You could try to use this custom hooked function, but it will not work (as this hook is fired before payment methods and payment gateways) : add_action( 'woocommerce_checkout_order_processed', 'changing_order_status_before_payment', 10, 3 ); function changing_order_status_before_payment( $order_id, $posted_data, $order ){ $order->update_status( 'pending' ); }