WooCommerce
May 26, 2020

Only Allow 1 Product in the Cart WooCommerce

We can set add to cart limit on WooCommerce cart using woocommerce_add_to_cart_validation filter. Add below code on functions.php file to limit your WooCommerce Cart to just 1 product.

Related Post


Get product details from $product object WooCommerce

I am publish this article for get values from WooCommerce $product object. You can get all information of product from $product object. When we have $product object. Get $product object by $product_id. Get $order object by $order_id. Get products from $cart object.

Get Currency symbol WooCommerce

You can get current currency in woocommerce using get_woocommerce_currency_symbol(); function.

WooCommerce Remove the Additional Information and Order Notes fields

We can remove the Additional Information and Order Notes fields in WooCommerce checkout page with 2 filters that you add to functions.php file.

How to Add Custom Product Fields in WooCommerce

For add custom fields in woocommerce use following code in your current themes functions.php file. This will display at admin product page. This will display at single Product Page. This will display at Cart and Checkout Page. This will display at order received and admin order Page.

Add a select field that will change price in Woocommerce simple products

To add a select field in simple products (like in variable products) that will update base price depending on the dopdown selected value, try this: Code goes in function.php file of your active child theme (or active theme).

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.


Leave a Reply

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