• Hi there,

    I have a private online shop in which I allow my clients to credit their wallet and pay with it (I’m using this plugin https://www.ads-software.com/plugins/woo-wallet/).

    I’d like to disable PDF invoice generation when a purchase is made with the wallet only, can you please help me out with this ?

    This is how I call in the “rechargeable product” in PHP : get_wallet_rechargeable_product()->get_id();

    Thanks for your help.

    Paul

Viewing 1 replies (of 1 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hi @phareweb35

    Please add the code snippet below:

    add_filter( 'wpo_wcpdf_document_is_allowed', function( $allowed, $document ) {
    if ( ! empty( $document->order) && 'invoice' === $document->get_type() ) {
    $order = $document->order;
    $payment_method = is_callable( array( $order, 'get_payment_method' ) ) ? $order->get_payment_method() : '';

    if ( 'wallet' === $payment_method ) {
    $allowed = false;
    }
    }

    return $allowed;
    }, 10, 2 );

    If you never worked with filters, please read this documentation page: How to use filters

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.