Questions tagged [orders]
USE ONLY for related questions to e-commerce. DO NOT USE in all other cases.
1,537
questions
0
votes
0
answers
30
views
Display previously ordered products in WooCommerce admin Related Orders
I would like to show previously ordered items under Related Orders in WooCommerce.
I found [Display order items names in WooCommerce admin orders list][1] answer code, that almost do what I am looking ...
1
vote
1
answer
54
views
Create a Woocommerce My Account Orders page showing only Completed orders
I deleted a previous question as it was poorly worded on my part. I'm trying to create a Woocommerce My Account Orders page that only shows completed orders. I have tried the following code but all of ...
0
votes
1
answer
53
views
Slow custom order search SQL query in WooCommerce
On a website with roughly 10k orders, our order search takes on average 20 seconds to complete while searching for order number. This is the sql-query that is slow
SELECT DISTINCT p1.post_id
FROM ...
1
vote
1
answer
35
views
WooCommerce Virtual products - Autocomplete orders after payment
I have virtual products and I would like them to be auto-completed when purchased.
I found the code pasted below, added it to functions.php, and it did work, BUT with one caveat:
When people choose ...
1
vote
1
answer
44
views
Alter WooCommerce order total efficiently instead of using set_total method
My customers can pay for their order via store credit (saved as user data), partly or completely.
In case the store credit is enough to cover for the whole order, the customer can only choose Store ...
1
vote
1
answer
56
views
Move an action button first in WooCommerce My account Orders page
Is it possible to always keep a specific action button first in the WooCommerce My Account Orders page?
I have a plugin which creates a "track" button once the order is shipped, and I'd like ...
1
vote
1
answer
46
views
Add product metadata using `add_product()` when cloning an order on WooCommerce
I am creating a cloning functionality for WooCommerce Order.
What I want is to make sure that the product item meta data is cloned properly.
/**
* Get the original order items to be clone
* Each ...
0
votes
1
answer
124
views
WooCommerce (HPOS) not placing new order in checkout after adding my custom fields
In my WooCommerce plugin I'm using woocommerce_checkout_update_order_meta hook to handle custom checkout fields I added.
First I add action:
add_action('woocommerce_checkout_update_order_meta', ...
0
votes
1
answer
65
views
Coupon is never created on WooCommerce payment_complete hook
I'm currently having some issue with a coupon creation in the payment_complete hook.
add_action('woocommerce_payment_complete', 'when_payment_complete');
function when_payment_complete( $order_id ) {
...
1
vote
1
answer
29
views
Add product short description after product title in WooCommerce order completed notification
I would like to add product short description after product title in woocommerce order completed email. What would be the correct snippet?
I tryid snippet here WooCommerce - Add product Short ...
2
votes
1
answer
64
views
Additional column in WooCommerce admin order list with the user login
I need to add a custom column "Customer" in the backend of WooCommerce orders list.
Here is some code that add additional columns to admin orders list and displays the user ID:
add_filter( '...
1
vote
0
answers
55
views
How to force WooCommerce shipping address to show in order emails?
I had to change the shipping_address_1 field to another custom field because of payment gateway regulations with a limit of 60 characters only, so the woocommerce doesn't recognise that I'm shipping ...
0
votes
0
answers
43
views
How to Make Stripe Checkout Sum Up Values?
Context: e-commerce Store that sends data to the Admin Dashboard and processes payments via Stripe Checkout. Built with React, Next.js, Prisma DB.
ISSUE: Instead of accounting for the shippingCost and ...
0
votes
0
answers
26
views
Determine if a WooCommerce order id represents a subscription, not a parent or renewal order [duplicate]
We use a third-party shipping website that gets notifications from our WooCommerce store via webhooks that they installed. The webhooks fire on any WooCommerce order create/update/delete activity. ...
4
votes
2
answers
270
views
Filtering orders list in WooCommerce with HPOS
I'm in the process of converting an open source plugin to be HPOS-compatible. One of its features is additional filters on the orders list in admin (inline with the order statuses), eg:
I can't seem ...
-1
votes
1
answer
102
views
Hide order items column name in WooCommerce admin
I'm trying to hide the columns in the administrative part of Woocomerce. With the following code I have not succeeded and I am stuck and my question is:
How can I hide the name of the columns in the ...
3
votes
1
answer
84
views
WooCommerce get product download url on receipt page
On the template for order-downloads.php there is reference to the download file delivered for the order. But the reference that it uses produces an encrypted string rather than show the actual url.
%s ...
1
vote
1
answer
55
views
Flag WooCommerce orders using REST API using custom metadata so I don't sync them again
I am syncing orders between my WooCommerce store and a 3rd party tool, and I am re-making the sync program using the REST API. I want to get a batch of new orders, and after inserting them into the db ...
1
vote
2
answers
81
views
WooCommerce search customer orders from product name or SKU
I'm trying to create a function inside WordPress to deploy in WooCommerce, so customers can look up for articles they've purchased by SKU or name.
The issue: is not working properly since no matter ...
0
votes
1
answer
41
views
Add a replcement billing email if empty for credit card paymen in WooCommerce
In WooCommerce, we have 2 payments methods, cash on delivery and credit card online.
I have the following problem in Checkout page:
The payment processor requires the email address from the customer, ...
0
votes
0
answers
20
views
Show "out of stock" when i add order manually in Woocommerce
When i add this code to my child theme function.php it prevents me as admin to add the product when i create a order and shows an alert "Product out of stock"
I want only the alert to be ...
1
vote
1
answer
39
views
Auto set custom metadata based on payment method for WooCommerce orders
I added a select field to WooCommerce admin order pages to order details section using:
add_action('woocommerce_admin_order_data_after_order_details', 'display_option');
function display_option( $...
3
votes
1
answer
54
views
Hide original subtotal line from WooComerce admin order totals
These post is related with Add a custom total line to WooCommerce admin order totals
Hello
I'm trying to hide Subtotal, but I can not find the class in CSS like:
.cart-subtotal { display: none; }
....
1
vote
1
answer
65
views
Get Dokan Seller details from WooCommerce order item
How to get the Dokan Vendor's Warehouse Address from a WooCommerce Order?
The Long Version:
I'm working on a WordPress/WooCommerce plugin for Automated shipment booking for which I need the Pickup ...
1
vote
1
answer
60
views
Change order reserved stock time for specific payment method in WooCommerce
I am using WooCommerce for selling some digital products. Due to the natural of our business, we do not want the item stock to go lower than 0 (-1, -2, etc.)
We are currently accepting different ...
2
votes
1
answer
54
views
Add a custom total line to WooCommerce admin order totals
In WooCommerce, I would like to put an extra field in wc-order-totals.
add_action( 'woocommerce_admin_order_totals_after_discount', 'vp_add_sub_total', 10, 1);
function vp_add_sub_total( $order_id )
{...
1
vote
1
answer
61
views
WooCommerce custom PDF plugin issue with order and order item data
For my WooCommerce store, I am writing a plugin that when an item is placed, creates a PDF with a picking list and a delivery label. It all works, except I can not seem to get the items in the order, ...
1
vote
1
answer
35
views
Woocommerce Subscriptions: User cancels product 76 subscription, then cancels all other Woocommerce subscriptions
add_action('woocommerce_subscription_status_updated', 'custom_subscription_status_change', 10, 3);
function custom_subscription_status_change($subscription_id, $new_status, $old_status) {
// ...
0
votes
1
answer
68
views
Capture payment method change when an order is updated via WooCommerce admin
I'm currently working on a WooCommerce project, and I'm trying to implement a feature where an order note is added when a user changes the payment method during the order editing process in the ...
1
vote
1
answer
73
views
Add non-existing order metadata to extend WooCommerce admin orders search for specific products
I have a question following my previous questions: Add non-existing order metadata to extend WooCommerce admin orders search
I have two questions:
First: If I want this md5 value to be saved only when ...
0
votes
1
answer
49
views
Add non-existing order metadata to extend WooCommerce admin orders search
I have a question following my previous questions: Allow search using billing email in WooCommerce Admin Orders list
Here are my codes to display email and email as md5, phone number and payment ...
3
votes
1
answer
83
views
Allow search using billing email in WooCommerce Admin Orders list
Based on Add columns to admin orders list in WooCommerce answer code, I was able to add 3 custom columns to Admin Orders list:
billing email,
billing phone,
payment method title.
My Code:
add_filter(...
-1
votes
1
answer
100
views
Add product custom field(s) dynamically when Adding products on WooCommerce manual orders
I want to be able to add extra product options to a product, when adding products to a new manually added order from the backend (as admin).
Now if go to WooCommerce -> Orders -> Add New
Then in ...
0
votes
1
answer
45
views
Validating current user in custom Ajax form updating Woocommerce order
I'm currently working on a form that allows users to update specific order details, including expense and the reason for the expense. The form displays a JavaScript alert upon successful update of the ...
0
votes
1
answer
64
views
Display Booking Start / End Date in WooCommerce Admin Orders list
I swiftly went through five other posts on Stack Overflow in an attempt to modify the code for the correct answer. Some of them looked promising, but none of them yielded the desired results. ...
1
vote
1
answer
48
views
Extend wc_get_orders() with multiple custom fields in WooCommerce 3+
I'm currently working on a project where I need to build a page to showcase specific details of WooCommerce orders. These details include the Order ID, order status (limited to completed orders), ...
1
vote
2
answers
47
views
How to get WooCommerce order items details in custom email content?
The first part of the question is HERE.
I need to get a list of items from a suborder that have received the status 'shipped' or 'readytocollect' inside $message_body = .
To do this, I was advised to ...
2
votes
1
answer
34
views
Add selected Delivery Point from Apaczka plugin on WooCommercel email notifications
On our WooCommerce shop pewne.eu, to cover shipments, we are using Apaczka plugin that handle different shipping methods available for our customers - parcel machines included - using Apaczka provider'...
1
vote
1
answer
54
views
Send email notification on custom order statuses only for Woocommerce sub orders [closed]
I'm using the code below, to add a custom order satus "readytocollect" and "shipped". When the order status changes, an email is sent to the buyer notifying that his order is being ...
1
vote
1
answer
31
views
Enforcing Mandatory Cancellation Notes for Improved Order Management in WooCommerce
I'm in the process of developing a system where it's imperative to include an order note explaining the reason for order cancellations on my e-commerce website. I've observed a consistent number of ...
2
votes
1
answer
168
views
Set the shipping method in WooCommerce Subscriptions renewal orders
When a user buys a product with the recurrent option which create an order each month, there is no shipping methods set. Only the parent order has the shipping method, and all child orders doesn't ...
2
votes
1
answer
105
views
Add an editable billing custom field to WooCommerce admin single order
I find a way to manually add a payment date on the order details into the back-office of WooCommerce.
I have created a field in the billing address, I find the way to a datepicker.
Everything works ...
1
vote
1
answer
44
views
COD payment with WooCommerce Subscriptions renewals: Customize order status
I am trying to use Cash on Delivery payment method with WooCommerce Subscriptions. But on renewal the order gets the status "Pending payment" (and the subscription goes "on-hold) I ...
2
votes
1
answer
29
views
Custom thankyou redirection if there is no products from specific category in WooCommerce
I have a function, that redirects WooCommerce checkout page to a custom site.
This code is working well, but I would like to enable that code only, if the product category is not "egyeb".
...
1
vote
1
answer
37
views
Get the payment methods history from WooCommerce customers
I've found a script that should help me get the information that I'm after: the payment method(s) that customers have used historically in their orders.
$order = new WC_Order( $order_id );
$...
1
vote
1
answer
61
views
Custom code in Woocommerce causes site crash when updating order status
If I try and update an order, ie: When looking at an order in backend, Order Actions > Choose and Action > Resend order notification as an example, it gives me a critical error as below.
This ...
1
vote
1
answer
126
views
Get custom order item meta key and display in new column in WooCommerce orders view
I am trying to create a new column in the WooCommerce orders table view. And populate it with the details of a custom meta key within the order. Only some orders will have this meta key value, only if ...
2
votes
1
answer
65
views
Reset order date paid for a custom order status in WooCommerce
The following answer code is not working, as I use the custom order status pre-ordered:
Change admin payment status back to unpaid for pending order status in Woocommerce
All my products are pre-...
2
votes
1
answer
109
views
Add a filter by date to My Account Orders in WooCommerce
Here is the Function, which enables me to create filter by date fields for WooCommerce orders in frontend (MY ACCOUNT). It's working, but when I choose date when there are no orders, Filter fields ...
0
votes
1
answer
106
views
Add a button linked to the order received Url in WooCommerce Admin Orders list
I'm trying to save the order-received URL in the Admin Area "Order Details Page".
According to this article posted 2 years, 7 months ago, it should work, but I followed all the Two Simple ...