WooCOmmerce Integration
-
Hello – Awesome plugin!
Is there any way to get the WooCommerce integration (specifically first/last order) to use Processing as well as Completed when checking rules?
Thanks!
-
Just been playing around with the code and have changed it to include wc_processing for order checks. However, it looks like the last order / first order checks are using payment processing dates, so not wc_completed?
I can’t get the visibility settings to respect the configuration. when I select last order with a category placed with in x days, it deosn’t want to show my content.
Any ideas?
Hi @mjwareha,
Thanks for reaching out. The check does use
wc_completed
, but the actual test uses a helper function. You can check out the code for the function here.$orders = wc_get_orders( array( 'customer_id' => get_current_user_id(), 'status' => array( 'wc-completed' ), ) );
Based on your use-case, should
wp_processing
be included in thestatus
array?- This reply was modified 2 months ago by Nick Diego.
Hi @ndiego, thanks for getting back to me. I found the helper class and changed it to look for wc-processing as well as wc-completed and it all worked great. So, yes, having wc-processing in the array would be great!
what would also be lovely would be having the check made on last order (without dates). I’m using it to display conditional content on the order thanks you page (amongst other things) so have currently set it to look for any orders less than or equal to 1 day, but if a user placed two orders on one day, they would see content that’s not relevant to their last order.
Thanks for the follow up. I can see why
wc-processing
should be added. Even if the order took a bit to complete, from the customer’s perspective, thewc-processing
date is when they ordered the product. I will get this update.what would also be lovely would be having the check made on last order (without dates). I’m using it to display conditional content on the order thanks you page (amongst other things) so have currently set it to look for any orders less than or equal to 1 day, but if a user placed two orders on one day, they would see content that’s not relevant to their last order.
Have you run into this situation? Even if there are multiple orders on the same day, the code should only return the either the first or last order.
I was being logic blind. Last order means last order! Thanks for the update.
Haha, no worries. Version 3.4.0 will be released tomorrow and it will include this update.
I am going to close this out, but let me know if I can help with anything else.
Best,
NickHi Nick – Me again!
I’m using BookingWP, which creates a new product type in WooCommerce (Appointment). This isn’t being picked up as a product type when using the WooCommerce filters to check for products etc. I’ve had a quick look at the code, but can’t see where you are setting the product type to check for WooCommerce product conditions.
I used to use WooCommerce Bookings, and these are show in the selection lists.
Any help greatly appreciated!
Marcus
Hi @ndiego, after some more testing, I’m not sure it does respect the ‘last order’ part of the rule (of course I could be doing something wrong!)
I’m running the rules on the WooCommerce Thank You page and setting blocks to show based on products in the last order (in other words, the order that has just been placed).
The settings are:
However, it shows even if the selected product is in a prior order rather than the last order.
Any ideas?
The date part works okay, so the block isn’t shown if the order is over a day old. It just doesn’t like the ‘last order’ rule.
Here’s the description of that visibility condition:
This rule evaluates the total number of days since the customer’s first, or last, completed order of a specific product from your WooCommerce store. You can select multiple products, but the number of days is evaluated per product and must be satisfied for all products for the rule to pass.
So it’s not evaluating the last order necessarily. It’s evaluating the last time the selected product was ordered, i.e. the last order that included the selected product.
For you use case, I’m thinking there would need to be a “Last order contained” type of rule. Does that sound right?
That would be exactly what I need! It allows a thank you (or other) page that displays conditional information based on the user’s last order.
- You must be logged in to reply to this topic.