• Resolved pablorodriguezsierra

    (@pablorodriguezsierra)


    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]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Josh Kohlbach

    (@jkohlbach)

    Thank you @pablorodriguezsierra for passing on the snippet and our thanks to the WPOvernight team (@pomegranate).

    We’ll include this in our next minor release which will be 2.5.0. After that you should be able to remove the snippet ??

    Keep an eye on the changelog.

    Plugin Author Josh Kohlbach

    (@jkohlbach)

    Hi @pablorodriguezsierra, could you confirm exactly where you see the double up?

    tonigin

    (@tonigin)

    Hello,
    I am going to follow this post, it happens to me too, when someone buys in my store they discount double the stock.

    Greetings

    irisslee95

    (@irisslee95)

    Hello @tonigin thanks for letting us know, we’ve confirmed it and will fix it soon

    tonigin

    (@tonigin)

    Thank you very much, I am waiting for the next update to solve the problem.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Duplicated orders’ is closed to new replies.