WooCommerce
June 4, 2020

Remove Product From Cart Programmatically Woocommerce

We can remove product from WooCommerce cart using remove_cart_item() function with $product_id.

Code goes in function.php file of your active child theme (or active theme).

Related Post


Change cart item prices based on custom cart item data in Woocommerce

We need to use 2 different hooks: The first one just as yours without trying to change the price in it. The second one where you will change your cart item price. The code: Code goes in function.php file of your active child theme (or theme) or also in any plugin file.

Set cart item price from a hidden input field custom price in Woocommerce

First for testing purpose we add a price in the hidden input field as you don’t give the code that calculate the price: Then you will use the following to change the cart item price (WC_Session is not needed): Code goes in function.php file of your active child theme (or active theme). Tested and works.

Change cart item prices in WooCommerce

WooCommerce Set Custom Product Price When Adding To Cart – In this article, we’ll see how we can override the price of product when adding the product into cart. With WooCommerce version 3.0+ you need: To use woocommerce_before_calculate_totals hook instead. To use WC_Cart get_cart() method instead To use WC_product set_price() method instead Here is the […]

Display Total Product Sold Quantity to WooCommerce Page

Currently your customers have no idea how many quantity or downloads have been ordered from your WooCommerce site. So in order to apply this change, you can add below code into your child theme’s functions.php file. This snippet code show you how to display total product sold quantity WooCommerce page.

How to Change “Return to Shop” Button text in WooCommerce

Change “Return to Shop” Button text in WooCommerce a WordPress plugin this is quit easy to change it using gettext filter. If you are not using shop or name it something like back to home or store. Code goes in function.php file of your active child theme (or active theme).

How Create Custom Order in Woocommerce

Paste the code where you can get the customer data Here is the function for creating the order


Leave a Reply

Your email address will not be published. Required fields are marked *