woocommerce

Get the order fee item details in Woocommerce 3

自作多情 提交于 2021-02-07 03:26:31
问题 I try to get the name of the fee attached to my order in Woocommerce, I get an array but I don't know how to get the name. I tried with function get_name () but it does not work. $the_order->get_items( array( 'line_item', 'fee', 'shipping' ) ); Raw data output: [137] => WC_Order_Item_Fee Object ( [extra_data:protected] => Array ( [tax_class] => [tax_status] => taxable [amount] => [total] => [total_tax] => [taxes] => Array ( [total] => Array ( ) ) ) [data:protected] => Array ( [order_id] =>

Woocommerce/Wordpress - Redirect User Login to Homepage

筅森魡賤 提交于 2021-02-07 03:14:36
问题 I have searched for the answer to this, used plugins and still nothing works. I would like users of my site to be redirected to the home page after they login/register. Currently, the user logs in and is redirected to the my account page. Woocommerce provides this code, but it failed to work for me: /* * goes in theme functions.php or a custom plugin * * By default login goes to my account **/ add_filter('woocommerce_login_widget_redirect', 'custom_login_redirect'); function custom_login

Woocommerce/Wordpress - Redirect User Login to Homepage

十年热恋 提交于 2021-02-07 03:12:09
问题 I have searched for the answer to this, used plugins and still nothing works. I would like users of my site to be redirected to the home page after they login/register. Currently, the user logs in and is redirected to the my account page. Woocommerce provides this code, but it failed to work for me: /* * goes in theme functions.php or a custom plugin * * By default login goes to my account **/ add_filter('woocommerce_login_widget_redirect', 'custom_login_redirect'); function custom_login

Woocommerce/Wordpress - Redirect User Login to Homepage

泪湿孤枕 提交于 2021-02-07 03:11:03
问题 I have searched for the answer to this, used plugins and still nothing works. I would like users of my site to be redirected to the home page after they login/register. Currently, the user logs in and is redirected to the my account page. Woocommerce provides this code, but it failed to work for me: /* * goes in theme functions.php or a custom plugin * * By default login goes to my account **/ add_filter('woocommerce_login_widget_redirect', 'custom_login_redirect'); function custom_login

Conditionally customizing WooCommerce checkout fields

孤者浪人 提交于 2021-02-06 14:17:31
问题 I am trying to modify WooCommerce check out fields. There are two points I want to reach. Conditional fields I want to make conditional fields for different shipping type in shipping section. To reach this point, Javascript is used. Administrator can edit the custom fields in the order on back-end As a result, I write the code as below. However, I met a problem. My javascript cannot work on the front-end. Does anybody can help me? //修改check out shipping field add_action( 'woocommerce_before

Conditionally customizing WooCommerce checkout fields

帅比萌擦擦* 提交于 2021-02-06 14:17:24
问题 I am trying to modify WooCommerce check out fields. There are two points I want to reach. Conditional fields I want to make conditional fields for different shipping type in shipping section. To reach this point, Javascript is used. Administrator can edit the custom fields in the order on back-end As a result, I write the code as below. However, I met a problem. My javascript cannot work on the front-end. Does anybody can help me? //修改check out shipping field add_action( 'woocommerce_before

Conditionally customizing WooCommerce checkout fields

微笑、不失礼 提交于 2021-02-06 14:11:39
问题 I am trying to modify WooCommerce check out fields. There are two points I want to reach. Conditional fields I want to make conditional fields for different shipping type in shipping section. To reach this point, Javascript is used. Administrator can edit the custom fields in the order on back-end As a result, I write the code as below. However, I met a problem. My javascript cannot work on the front-end. Does anybody can help me? //修改check out shipping field add_action( 'woocommerce_before

Woocommerce: function to update all products

孤人 提交于 2021-02-06 13:01:09
问题 I have an issue with my Woocommerce products. This issue is fixed if I just update the product (edit the product and click in the Update button) with no changes at all. I have around 2000 products in my site, then I am thinking of doing this using a function in my function.php file. It should be something like this, I just need the line which update the product. function update_all_products(){ // getting all products $products = get_posts( $args ); // Going through all products foreach (

Woocommerce: function to update all products

北战南征 提交于 2021-02-06 12:58:50
问题 I have an issue with my Woocommerce products. This issue is fixed if I just update the product (edit the product and click in the Update button) with no changes at all. I have around 2000 products in my site, then I am thinking of doing this using a function in my function.php file. It should be something like this, I just need the line which update the product. function update_all_products(){ // getting all products $products = get_posts( $args ); // Going through all products foreach (

Change “add to cart” text if a user has bought specific products in WooCommerce

懵懂的女人 提交于 2021-02-05 12:13:37
问题 I wanted to know if there is a way to replace the woo-commerce "add to cart" button with custom text and url for a specific product if the user has bought that specific product. and I want it happens everywhere (on shop page,product page , ...) 回答1: Try the following that will change the product "add to cart" text if that product has already been bought by the customer on single product pages and archive pages add_filter( 'woocommerce_product_add_to_cart_text', 'custom_add_to_cart_text', 900,