Hi There,
On line 147 in the clone order class just add the folowing :-
$order->add_order_note('Order cloned to #'.$order_id.'');
Cheers
J
So will this add the order note in the original order that the clone was cloned from? It looks like it would just add another note to the same order? Or am I wrong?
I would like it so you could access the old order and see a note saying “Order cloned to #”, so there’s a bit if a paper trail between the orders.
Would also be cool if there was a clickable link in the note, I’m not sure if that’s even possible in woocommerce.
Thanks for helping me out with this!
-
This reply was modified 5 years, 11 months ago by
Headsaflame.
-
This reply was modified 5 years, 11 months ago by
Headsaflame.
Hi,
I am unsure if you emailed yeterday but i sent a quick solution via email :-
On line 146 add :-
$original_order->add_order_note(‘Order Cloned to #’.$order_id.”);
Above
$order->add_order_note(‘Cloned Order from #’.$this->original_order_id.”);
This should create the paper trail you can use html in the notes so could link to the order ids using the variables.
Cheers
J
Thanks so much for your help! I was able to get the code to work and also add links to the actual orders, here’s what my code looks like:
// Set order note of original cloned order
$original_order->add_order_note('Order Cloned to: <a href="'.site_url().'/wp-admin/post.php?post='.$order_id.'&action=edit">'.$order_id.'</a>');
// Set order note in cloned order
$order->add_order_note('Order Cloned From: <a href="'.site_url().'/wp-admin/post.php?post='.$this->original_order_id.'&action=edit">'.$this->original_order_id.'</a>');
-
This reply was modified 5 years, 11 months ago by
Headsaflame.
I noticed that this action is only accessible from the orders screen, is there a way to add the same action to the order edit screen? Our staff rarely use the orders screen, they’re usually going directly into orders to edit them.