Chunkford
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Hi,
I’m using your free version so I won’t be able to give you a payment ID if you asked me for one and is why I posted here.
I don’t need support, this isn’t a custsomisation request and is purely an issue with your code I have spotted.Forum: Plugins
In reply to: [WooCommerce] WC 3.x – Remove a product from an order objectI used
$order->remove_item( $item->get_id() )on another product that has an actual ID instead of thenew:line ID and it worked.So I presume it’s just won’t work for items that have
new:as the idabstract-wc-order.php
// Append new row with generated temporary ID if ( $item_id = $item->get_id() ) { $this->items[ $items_key ][ $item_id ] = $item; } else { $this->items[ $items_key ][ 'new:' . sizeof( $this->items[ $items_key ] ) ] = $item; }So to get round it I used the hook
woocommerce_checkout_order_processedinstead, and it works fine.Thanks for replying Mike
- This reply was modified 9 years, 1 month ago by Chunkford.
Forum: Plugins
In reply to: [WooCommerce] WC 3.x – Remove a product from an order objectIf it helps, when I do
$item->get_id()for the match it returns0
Dumping the$itemit has the key ofnew:0
Viewing 3 replies - 1 through 3 (of 3 total)