• How to resend New Store Order to vendor, there comes a point admin might need to resend new order notification to the vendor. I don’t see any option within the plugin. Is there any hooks where i can work on top of it.

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author WC Lovers

    (@wclovers)

    there comes a point admin might need to resend new order notification to the vendor. I don’t see any option within the plugin. Is there any hooks where i can work on top of it.

    – It’s not possible to re-send this email manually. But can be trigger on a specific condition like order status change.

    Thread Starter NaFi

    (@nafi121)

    Could you please help me on the snippet, for a custom order status “WC-Resend” ?

    Plugin Author WC Lovers

    (@wclovers)

    Please use this snippet for the purpose –

    add_action( 'woocommerce_order_status_changed', function( $order_id, $status_from, $status_to ) {
    	$current_order_status = 'wc-'.$status_to;
    	if( in_array( $current_order_status, array( 'wc-resend', 'WC-Resend', 'wc-Resend' ) ) ) {
    		$wcfmmp_email = WC()->mailer()->emails['WCFMmp_Email_Store_new_order'];
    		if( $wcfmmp_email ) {
    			$wcfmmp_email->trigger( $order_id );
    		}
    	}
    }, 200, 3 );

    Add custom code(s) to your child theme’s functions.php
    In case you do not have child theme then add those using this plugin –?https://www.ads-software.com/plugins/code-snippets/

    Thread Starter NaFi

    (@nafi121)

    Thanks, I would suggest to add a button to trigger this on the next update

    Plugin Author WC Lovers

    (@wclovers)

    Where you want to have this button?

    Thread Starter NaFi

    (@nafi121)

    anywhere in admin dashboard either on wc or wcfm, so that admin can trigger this action in case vendor request to resend email notification

    Plugin Author WC Lovers

    (@wclovers)

    Kindly add this snippet to your site –

    add_action( 'wp_ajax_wcfm_resend_order_email', function() {
    	$order_id = $_POST['order_id'];
    	if($order_id) {
    		$wcfmmp_email = WC()->mailer()->emails['WCFMmp_Email_Store_new_order'];
    		if( $wcfmmp_email ) {
    			$wcfmmp_email->trigger( $order_id );
    		}
    	}
    	die;
    });
    add_action( 'wcfm_order_details_after_order_table', function( $order ) {
    	if( !wcfm_is_vendor() ) {
    		echo '<a id="wcfm-order-' . $order->get_id() . '" data-order="' . $order->get_id() . '" href="#" class="wcfm_resend_order_email add_new_wcfm_ele_dashboard text_tip" style="float:left!important;color:#ffffff!important;margin-right:10px;" data-tip="' . __('Click to resend vendor order email', 'wcfm-gosend') . '"><span class="">' . __( 'Resend Vendor Order Email', 'wc-frontend-manager-ultimate') . '</span></a>';
    		echo '<div class="wcfm_clearfix"></div><br />';
    		?>
    		<script>
    		jQuery(document).ready(function($) {
    			$('.wcfm_resend_order_email').click(function( event ) {
    				event.preventDefault();
    				var rconfirm = confirm( "Do you really want to do this?" );
    				if( rconfirm ) {
    					var data = {
    						action      : 'wcfm_resend_order_email',
    						order_id    : $('.wcfm_resend_order_email').data('order')
    					}	
    					$.ajax({
    						type:		'POST',
    						url: wcfm_params.ajax_url,
    						data: data,
    						success:	function(response) {
    							//window.location = window.location.href;
    						}
    					});
    				}
    				return false;
    			});
    		});
    		</script>
    		<?php
    	}
    }, 500 );

    Add custom code(s) to your child theme’s functions.php
    In case you do not have child theme then add those using this plugin –?https://www.ads-software.com/plugins/code-snippets/

    Now you will have a button “Resend Vendor Order Email” under Admin’s order details page – https://ibb.co/VTc5rv8

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to Resend “New Store Order” email to vendor?’ is closed to new replies.