Redirect to shop if cart is emptied on cart page in WooCommerce 3+

In WooCommerce I want to redirect from cart to shop page when cart is empty and I am using this code: function cart_empty_redirect_to_shop(){ global $woocommerce; if ( is_page(‘cart’) and !…

Hide specific variation attributes displayed in WooCommerce cart items

I want to hide specific variations from the cart page in Woocommerce, I was able to hide all the variation names but I want to keep 3 that need to be shown. The following code shows all the variations …

Custom shipping rates programmatically in Woocommerce

I Want to calculate custom shipping rates based on cart amount for woocommerce, My requirement as follows, Cart amount 0-10 => £4.99 (shipping_rate_id = flat_rate:12), 10-20 => £3.99 (…

Add extra cost to flat rate shipping each 2 items from specific category in WooCommerce

Based on Add an additional cost to flat rate shipping each 3 items in Woocommerce answer code, I have made some changes to add an additional cost to flat are shipping method each 2 items (instead of …

Hot to add subcategories under category element in woocommerce flatsome theme WordPress

I’m trying to set up e-commerce website. Ran into a problem with Categories element. I want the element to represent not only categories, but also subcategories below itself. I also cannot edit page …

core file deleted in woocommerce / wordpress

I have noticed that the file “wp-admin/includes/ajax-actions.php” is deleted automatically in production. Even if I upload this file via ftp, it gets deleted after some time ( ~5min ). I …

Remove “Search Results: ‘%s’” and blank space from Woocommerce Shop Search Results Page

I am trying to remove the “Search results: ‘ ‘ ” text that shows above products on the Woocommerce Storefront search results page. Below is an image with the referenced text circled: I have …

Assign a percentage fee to WooCommerce payment methods based on user roles

How do I expand this snippet to include 2 more payment gateways with different fees? The payment gateways I want to add are ‘cardgategiropay’ and ‘cardgateideal’ and the fees are 3% and 2% …

Woocommerce: add text before add-to-cart only on specific single product pages

I found the following code in order to display text before the add-to-cart-button on a single product page: // adds notice at single product page above add to cart add_action( ‘…

Remove out of stock products from WooCommerce related products custom WP query

hello I want to show related products based on my custom query but I just want to show ‘in_stocks’ products and meta_query not working with tax_query. anyone can help me? $query_args = array( ‘…