Yo #AI and/or #coding / #Woocommerce wizards.
I'm setting up a website on Woocommerce. Digital products are "completed" automatically on payment. That's fine, that's how it should be. But I also have the "Product Add-Ons for WooCommerce" plugin installed, I need the order status to remain in "Processing" in case an add-on is added to the product. I've tried ChatGPT and Claude.AI (both free versions) for solutions, I've tried exactly 5 iterations of ChatGPT + 2 iterations of Claude "solutions" - none of them work.
Obviously I've also tried finding another plugin that would allow for me to change the order status flow, but haven't found anything applicable.
Any ideas/solutions? Are paid versions of ChatGPT, Claude AI or anything else any better at coding?
DISCLAIMER: I don't know anything about coding myself.
A solution / good suggestions get zapped (obviously). 🤠
#asknostr #programming #ecommerce
CC/ @TheGuySwann, @PABLOF7z, @Ava, @Pavlenex, @ROCKSTAR, @RayBuni
Hmmm, do you actually need to do them separately? In other words, could you not add a prompt before checking out with a digital item that says “do you need any add ons?” With a list of options so that they don’t complete the sale until you know they are already sure of all that they want?
I don’t know the product/service they are buying exactly, so maybe this situation is a little different, but I feel I wouldn’t want someone to complete a sale for an item with add ons, until they have already selected all of the add ons — which sounds like what you are doing, but it seems you are trying to hack it together *after* the purchase, rather than ensuring the add ons have been fully selected *before* they actually make the purchase.
If you are having trouble (or honestly if you are having to code AT ALL in this situation — which is too much headache, imo — then I would go that route instead.
Unfortunately I don’t know enough about woocommerce or webdev stuff to be of much use if you are set on doing it via the “processing” route.
PS. Another reason I might stay away from hacked together code for an added “processing” stage, is because it’s likely to break very easily with any updates or changes to the other tools.
No, you see I am trying to do it before the purchase and also before the checkout page. The digital product can be bought as is (in which case it all works perfectly right now, the order is completed as soon as the customer pays and he/she gets the download link).
OR on the product page, the customer can choose a particular add-on service, in which case I need to manually prepare the files before sending them out to the customer and marking the order as "completed" - hence why it needs to stay in a "processing" status. The checkout page is too late to be asking about the add-ons, the option needs to be visible and prominent from the very beginning, because it's a feature that sort of changes the dynamics of how the product will be used later.
If you're interested in details I can share them via a DM - it's actually a really simple idea, but I'm not yet fully comfortable putting it all out in the public - little, but critical hiccups like this one are a big part of it. 😄
The PS part is probably very true though... damnit. Might need to start seriously looking into hiring a dev.
What do you use for the automation and stuff you usually do with AI though? ChatGPT? Or I remember something about you building your own rig for it and training your own model? I'm sorry if this has been asked a million times from you, I haven't been following AI Unchained super closely TBF 😄
Which payment method are you using?
I love phind.com as an ai assistant for coding.
In case anybody has the same problem/question and you happen to come across this post:
I contacted Woo support regarding the question and asked whether Woocommerce Order Status Control plugin would enable me to do what I described. After receiving a useless AI-genereted answer and asking for a human to answer me (and waiting for a day), I actually got a solution from the support:
1. Install Code Snippets plugin if you haven't: https://wordpress.org/plugins/code-snippets/
2. Copy/paste this code into the .PHP section:
add_filter( 'woocommerce_payment_complete_order_status', 'wc_set_addon_orders_to_processing', 10, 3 );
function wc_set_addon_orders_to_processing( $status, $order_id = 0, $order = false ) {
if ( 'completed' !== $status ) {
return $status;
}
if ( ! $order && ! $order_id ) {
return $status;
}
$order = $order ? $order : wc_get_order( $order_id );
if ( $order ) {
$items = $order->get_items();
foreach ( $items as $item ) {
if ( ! empty( $item->get_meta( '_pao_ids' ) ) ) {
$status = 'processing';
break;
}
}
}
return $status;
}
Seems to be working for me!