• Resolved parahealth

    (@parahealth)


    Hello,

    we want to use your plugin with a specific payment method. Is there any method, to make the plugin work ONLY for a specific method? (The invoices should be sent per mail and can be downloaded when logged in)

    We are using the Professional version.

    Best regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Darren Peyou

    (@dpeyou)

    Hey @parahealth,

    You can use this code snippet:

    add_filter( 'wpo_wcpdf_document_is_allowed', 'wpo_wcpdf_invoice_based_on_payment_method', 10, 2 );
    function wpo_wcpdf_invoice_based_on_payment_method( $allowed, $document ) {
      if ( $order = $document->order ) {
        if ($document->type == 'invoice') {
          $allowed = ( $order->get_payment_method() == 'billie' ) ? true : false;
        }
      }
      return $allowed;
    }

    How to use hooks

    > The invoices should be sent per mail and can be downloaded when logged in)
    For that you need to select the correct WooCommerce email under “Attach To” in WooCommerce > PDF Invoices > Documents

    Plugin Contributor Darren Peyou

    (@dpeyou)

    @parahealth,

    I forgot to mention that since you are using the Professional extension, you’ll need to email us at [email protected] for help in the future. This is because WordPress doesn’t allow us to offer support for paid software here in the forums. ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Invoices for specific payment method’ is closed to new replies.