Questions tagged [woocommerce]

WooCommerce: a WordPress plugin. For how-to-use questions, ask their support team. It's mostly open source. On-topic questions: programming which changes or extends WooCommerce behavior. Questions about 3rd party plugins should be asked directly to the plugin support.

is a commercially supported open source available for .

It allow you to freely sell products from your WordPress site. WooCommerce is enterprise-level quality and is built in , , and .

WooCommerce It is now owned by its parent company Automattic.

Before submitting a question

  • Ensure you have the latest versions of WordPress, your theme and all plugins.
  • Check for theme or plugin conflicts. This includes switching to a default WordPress theme such as Twenty Seventeen and disabling all other plugins.
  • Remember, Stack Overflow is not an official support channel for WooCommerce. That support channel is here.

System Status Report
It may help to have a look at the System Status Report to detect some problems and warnings. This can be found in your WordPress dashboard and going to WooCommerce > System Status.

Useful Links


Related Tags

32907 questions
33
votes
5 answers

where is a woocommerce order placed in wordpress database

Where do order and everything in it is stored in the database after it is placed from a WordPress woo-commerce website? To be more precise, how can I get my shipping address without using woocommerce classes like WC_Order class? I mean I need to get…
MAK
  • 331
  • 1
  • 3
  • 6
32
votes
1 answer

Having trouble working with SelectWoo instances of Select2 within WooCommerce

I am using Select2 within WooCommerce in some of my own custom areas and I am targeting it with some code to add and removes certain classes and it's working fine except for the SelectWoo instances used by WooCommerce themselves do not add the class…
Brett
  • 19,449
  • 54
  • 157
  • 290
32
votes
3 answers

Woocommerce - Getting the order item price and quantity.

Using Woocommerce 2.6.8 , I can't get the Order Item Data information as described in the docs and here on SO. All I want is to get the Line Item price and Quantity, which should be as simple as: $order = new WC_Order( $order_id ); $order_items =…
robobobobo
  • 739
  • 1
  • 9
  • 19
32
votes
12 answers

Get woocommerce carts total amount

I am trying to apply a discount to a carts total price, but I can only do it to the item base price and not the over all price. I Googled and came across this post in the wordpress stackoverflow: $amount = floatval( preg_replace( '#[^\d.]#', '', …
Howli
  • 12,291
  • 19
  • 47
  • 72
32
votes
9 answers

Woocommerce add to cart button redirect to checkout

I created an ecommerce using the plugin woocommerce. I am selling only a subscription so the "/cart/" page is useless. I'm trying to get rid of it so that when my customer click on "Add to cart" button, he ends up on the checkout page.
Michael Villeneuve
  • 3,933
  • 4
  • 26
  • 40
31
votes
13 answers

Create programmatically a WooCommerce product variation with new attribute values

I have created a variable product ("parent" product) in WooCommerce version 3+. From a WordPress plugin, I would like to programmatically create the product variations ("children" product) with new attribute values. The variation attributes are…
Cedric
  • 5,135
  • 11
  • 42
  • 61
31
votes
5 answers

Override Plugin Function in WordPress

I have a Plugin installed on my WordPress site. I'd like to override a function within the Plugin. Do I override this in my theme's functions.php and if so, how do I do this? Here's the original function in my plugin: /** *…
michaelmcgurk
  • 6,367
  • 23
  • 94
  • 190
31
votes
5 answers

woocommerce variations

I am creating a woocommerce theme and I have product variations i.e. size which is displayed on product details page but problem is that I want to get all variations in my custom php page by using product id, can any one help me. Thanks in advance.
Sachin Magar
  • 411
  • 1
  • 6
  • 3
31
votes
3 answers

Override WooCommerce Frontend Javascript

Can someone guide me as to what is the proper method of overriding WooCommerce core Javascript files, specifically frontend files. I have not found any documentation on this and looking at the code, the path to the frontend script files is hard…
Sebastien
  • 2,607
  • 9
  • 30
  • 40
30
votes
6 answers

How to modify WooCommerce cart, checkout pages (main theme portion)

I have been researching and tweaking away at my custom Wordpress theme and overridden WooCommerce templates with now WooCommerce installed to rectify a bunch of small formatting issues that occur on the WooCommerce pages. I'm down to now the cart…
Michael K
  • 1,031
  • 2
  • 14
  • 27
30
votes
3 answers

How to check payment method on a WooCommerce order by id?

I want to make some changes if the chosen payment method is COD. On existing WC_Order i have used ($order->payment_method_title == 'Cash On Delivery' ? ... : ... ); to retrieve the title. But i would like to check against the id (cod) because the…
belfort1
  • 887
  • 2
  • 8
  • 14
30
votes
6 answers

How can I get the order ID in WooCommerce?

How do I retrieve the order ID in WooCommerce?
Kourosh
  • 917
  • 1
  • 11
  • 24
29
votes
2 answers

Get Order items and WC_Order_Item_Product in WooCommerce 3

Reading up the changes in WooCommerce 3.0, it seems that is not possible to anymore properties from order items directly, so I would assume that the following code needs to be changed, since it is spitting out an error: $order_item_id =…
Solomon Closson
  • 6,111
  • 14
  • 73
  • 115
29
votes
5 answers

WooCommerce: trigger event after change of variation

We use Woocommerce to sell colorboxes. Mostly the variable-product option is chosen. We added a modal dialog with a color palette, where the customer can chose a color from. This is next to the common dropdown of woocommerce. The problem is that…
MJay
  • 487
  • 1
  • 6
  • 13
29
votes
8 answers

How to clear a Woocommerce cart

I am wondering how you can clear the contents of your cart on page load using woocommerce. I came accross how to add a clear cart button using by adding this in to functions.php add_action( 'init', 'woocommerce_clear_cart_url' ); function…
user1370288
  • 909
  • 3
  • 10
  • 20