Duplicated orders
-
Hi! we’ve been tracking an error where when an order was created in woocommerce, using PDF Invoices & Packing Slips for WooCommerce and PDF Invoices & Packing Slips for WooCommerce – Professional, and HPOS with compatibility mnode active, there was a duplicated, incompleted order simultaneously created. So for every order, two invoices where created with consecutive numbers (the “ghost” one had no customer details), but the order would not show on the admin dashboard.
With the help of PDF Invoices & Packing Slips for WooCommerce team, we found out that the conflict was with WC Vendors. They worked out a snippet to prevent this duplication, coded as follows:
/**
- WPO – PDF Invoices & Packing Slips for WooCommerce
- Disallow the creation of documents for orders with “shop_order_vendor” type which will be created by “WC Vendors Marketplace” plugin.
* - @param bool $allowed
- @param \WPO\WC\PDF_Invoices\Documents\Order_Document $document
* - @return bool
*/
function disallow_document_creation_for_shop_order_vendor_type( bool $allowed, \WPO\WC\PDF_Invoices\Documents\Order_Document $document ): bool {
if ( ! empty ( $document->order ) && ‘shop_order_vendor’ === $document->order->get_type() ) {
return false;
} return $allowed;
}
add_filter( ‘wpo_wcpdf_document_is_allowed’, ‘disallow_document_creation_for_shop_order_vendor_type’, 10, 2 );
Is there a fix in the plugin to prevent this duplication, avoiding to have to use this snippet? Does the plugin still work normally having this snippet active?
Thanks!
The page I need help with: [log in to see the link]
- The topic ‘Duplicated orders’ is closed to new replies.