• Resolved eoinkennedy

    (@eoinkennedy)


    Hi,

    Is it possible to remove the Packeta section from the bottom of the email sent to a customer when processing a refund?

    Is there a filter that can be used for this?

    Thank you,
    Eoin

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Martin Svoboda

    (@martinsvoboda)

    Hi,
    yes, it is posible.
    Section is added by action add_action( 'woocommerce_email_customer_details', array( $this, 'add_packeta_to_email_notifications' ), 25, 4 );
    So you can remove it by removing this action in specific condition by function remove_action( 'woocommerce_email_customer_details', array( wpify_woo_container()->get( PacketaShippingModule::class ), 'add_packeta_to_email_notifications' ) );

    Thread Starter eoinkennedy

    (@eoinkennedy)

    Hi,

    Thank you for the reply.

    Does this remove the Packeta details from all emails, or just the Refund type?
    Can it also be removed from the Invoice type if it appears there too?

    But when I try to save the code (using Code Snippets), I get an error:
    Uncaught WpifyWooDeps\DI\NotFoundException: No entry or class found for ‘PacketaShippingModule’

    Plugin Contributor Martin Svoboda

    (@martinsvoboda)

    Hi,
    this is not the whole snipet but just a function that disables a specific part of the plug-in. You have to create a snippet with your own conditions. The function itself removes the Packeta in all emails.
    You can use this snippet as a base and add your own conditions for when to cancel the action.

    use WpifyWoo\Modules\PacketaShipping\PacketaShippingModule;
    
    add_action( 'woocommerce_email', function ( $email_class ) {
    	if ( your conditions ) {
    		remove_action( 'woocommerce_email_customer_details', array(
    			wpify_woo_container()->get( PacketaShippingModule::class ),
    			'add_packeta_to_email_notifications'
    		) );
    	}
    }, 10, 1 );
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove Packeta Shipping section from Refund Email’ is closed to new replies.