Woocommerce Advanced Shipping (WAS) condition is not being called when selecting “Ship to different address” [closed]

Your code is good and shouldn’t be the issue (as long as the shipping rate is active/published and has the condition). I think its related to the shipping cache; WC doesn’t re-calculate the shipping cost if nothing has changed for the destination (so the billing would be the same as the shipping address). You can … Read more

How to make an edit to an already published post back to Draft

Add below code in your current theme’s functions.php file. You have to replace USER ROLE with your user role name in if condition. function check_edit_post($post_id){ global $post; if( in_array(‘USER ROLE’, wp_get_current_user()->roles) && ‘product’ == get_post_type($post_id) && ‘publish’ == get_post_status($post_id) && $post->post_date != $post->post_modified ){ wp_update_post(array( ‘ID’ => $post_id, ‘post_status’ => ‘draft’ )); } } add_action( … Read more

WooCommerce get_author_posts_url() – Author URL redirecting to shop base

I found! https://wordpress.org/support/topic/how-to-add-author-page-to-custom-user-role/#post-8807168 So in WooCommerce, this is achieved by the following code in wp-content/plugins/woocommerce/includes/wc-user-functions.php: /** * Disable author archives for customers. * * @since 2.5.0 */ function wc_disable_author_archives_for_customers() { global $wp_query, $author; if ( is_author() ) { $user = get_user_by( ‘id’, $author ); if ( isset( $user->roles[0] ) && ‘customer’ === $user->roles[0] ) { … Read more

How to remove products-links after the product title using remove_action

First, you’re correct that removing the action calling the products_links method would work, and that this is specifically MrBara_WooCommerce->products_links(). In your functions.php, you can just use remove_action without wrapping it in a function used as a callback for another add_action, btw. so: remove_action(‘products_links, array(‘MrBara_WooCommerce’, ‘woocommerce_single_product_summary, 0) 10 is default priority, and while we may assume … Read more