woocommerce

Disable add to cart button based on WooCommerce product custom stock status

假如想象 提交于 2021-02-16 20:00:11
问题 Currently in woocommerce, add to cart button disabled, if the stock status is out of stock . I add new stock status with the label Discontinued product by using woocommerce_product_stock_status_options , now I am looking for a way to treat this product like it is out of stock. Since I believe it is better to separate between a product that is not produced anymore and a product that produced and available in another store but it's not in stock. 回答1: You can use the following to disable add to

Add custom tax value at woocommerce checkout

情到浓时终转凉″ 提交于 2021-02-16 14:35:12
问题 I want to add custom % value at woocommerce checkout page, but I want to show it only for Swiss country and hide it for others. Now I have the right code working for that, but the problems is that Im not able to show it when user choose switzerland. Here is a code so please help me see what Im doing wrong here //Add tax for CH country add_action( 'woocommerce_cart_calculate_fees','woocommerce_custom_surcharge' ); function woocommerce_custom_surcharge() { global $woocommerce; if ( WC()-

custom add to cart redirection for a defined product category in WooCommerce 3

ε祈祈猫儿з 提交于 2021-02-16 14:13:34
问题 On a WooCommerce website I would like to be redirect customers on checkout page just after a product is added to cart. However we want it to be for that specific product category instead of all the add to cart buttons. I have tried to look up past solutions but they either just crash my site when I update the functions.php or they are outdated and don't work anymore. I really appreciate any help. 回答1: Updated: Add to cart redirection will not work with ajax add to cart on shop and archives

custom add to cart redirection for a defined product category in WooCommerce 3

两盒软妹~` 提交于 2021-02-16 14:12:54
问题 On a WooCommerce website I would like to be redirect customers on checkout page just after a product is added to cart. However we want it to be for that specific product category instead of all the add to cart buttons. I have tried to look up past solutions but they either just crash my site when I update the functions.php or they are outdated and don't work anymore. I really appreciate any help. 回答1: Updated: Add to cart redirection will not work with ajax add to cart on shop and archives

Add a new order status that Send an email notification in WooCommerce 4+

℡╲_俬逩灬. 提交于 2021-02-16 14:07:20
问题 I would like to add a new order status and email notification to my site in conjunction with this order status. I tried this code: // register a custom post status 'awaiting-delivery' for Orders add_action( 'init', 'register_custom_post_status', 20 ); function register_custom_post_status() { register_post_status( 'wc-awaiting-delivery', array( 'label' => _x( 'Kargoya Verildi', 'Order status', 'woocommerce' ), 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true,

Move additional information from product tab under add to cart button in WooCommerce

谁都会走 提交于 2021-02-16 04:14:55
问题 In single product pages, I would like to change the location of "additional information" from tabs, under add to cart button using Woocommerce hooks (removing the "additional information" tab) . I have: add_action( 'woocommerce_product_additional_information', 'wc_display_product_attributes', 10 ); and: woocommerce_after_add_to_cart_button I'm trying: remove_action( 'woocommerce_product_additional_information', 'wc_display_product_attributes', 10 ); add_action( 'woocommerce_after_add_to_cart

Move additional information from product tab under add to cart button in WooCommerce

笑着哭i 提交于 2021-02-16 04:11:28
问题 In single product pages, I would like to change the location of "additional information" from tabs, under add to cart button using Woocommerce hooks (removing the "additional information" tab) . I have: add_action( 'woocommerce_product_additional_information', 'wc_display_product_attributes', 10 ); and: woocommerce_after_add_to_cart_button I'm trying: remove_action( 'woocommerce_product_additional_information', 'wc_display_product_attributes', 10 ); add_action( 'woocommerce_after_add_to_cart

Move additional information from product tab under add to cart button in WooCommerce

♀尐吖头ヾ 提交于 2021-02-16 04:09:46
问题 In single product pages, I would like to change the location of "additional information" from tabs, under add to cart button using Woocommerce hooks (removing the "additional information" tab) . I have: add_action( 'woocommerce_product_additional_information', 'wc_display_product_attributes', 10 ); and: woocommerce_after_add_to_cart_button I'm trying: remove_action( 'woocommerce_product_additional_information', 'wc_display_product_attributes', 10 ); add_action( 'woocommerce_after_add_to_cart

Hide payment method based on product type in WooCommerce

守給你的承諾、 提交于 2021-02-16 03:56:53
问题 In WoCommerce, I would like to disable particular payment methods and show particular payment methods for a subscription products in WooCommerce (and vice versa). This is the closest thing we've found but doesn't do what I am expecting. Yes, there are plugins that will do this but we want to achieve this without using another plugin and without making our stylesheet any more nightmarish than it already is. Any help on this please? 回答1: Here is an example with a custom hooked function in

Hide payment method based on product type in WooCommerce

↘锁芯ラ 提交于 2021-02-16 03:56:00
问题 In WoCommerce, I would like to disable particular payment methods and show particular payment methods for a subscription products in WooCommerce (and vice versa). This is the closest thing we've found but doesn't do what I am expecting. Yes, there are plugins that will do this but we want to achieve this without using another plugin and without making our stylesheet any more nightmarish than it already is. Any help on this please? 回答1: Here is an example with a custom hooked function in