Advance Partial Shipment for woocommerce

Details #

The Advance Partial Shipment for woocommerce plugin helps to manage partially shipped orders in woocommerce. The store manager or admin can ship ordered products in parts and can keep records in the backend. It provides input to add tracking number and tracking URL along with product quantity for every shipment you send. It sends an email notification to the customer if any new shipment is created or updated, so the customer can track and see the shipment details.

Settings/Options #

Add Status “Partially Shipped”: #

This option will add a new custom order status to wocommerce order status list, so if store manager or admin ship any order partially then the order status will be switched to “Partially Shipped” status.

Mark auto “completed”: #

if the option is enabled, auto will be switched to “completed” status when all order item are shipped.

Display status in order popup: #

it will display the shipped quantity in the popup when you click on the “eye” icon on order list admin page.

Enable API: #

It will enable the JSON/CURL API to get order items data and update the shipped quantity via POST CURL Request.

API Webhook URL: #

It displays the webhook URL to use in JSON/CURL API.

Label “Shipped”: #

Label Text you want to display for shipped items, these label will appear on order details page(Front end) for Customer and on the shipment details page in backend.

Label “Not Shipped”: #

Label Text you want to display for Non shipped items, these label will appear on order details page(Front end) for Customer and on the shipment details page in backend.

Label “Partially Shipped”: #

Label Text you want to display for Partially shipped items, these label will appear on order details page(Front end) for Customer and on the shipment details page in backend.

 

Filters/Hooks Used in plugin: #

    • ‘wphub_shipment_completed_order_subject’ : This filter can be used to modify email subject line for completed order email sent by Advance Partial Shipment Plugin.
      Example:

      add_filter('wphub_shipment_completed_order_subject','wphub_shipment_order_completed_subject');
      function wphub_shipment_order_completed_subject($subject){
         return __('Your {site_title} order is completed!','wxp-partial-shipment');
      }
  • ‘wphub_shipment_partially_order_subject’ : This filter can be used to modify email subject line for partially shipped order email sent by Advance Partial Shipment Plugin.
    Example:

    add_filter('wphub_shipment_partially_order_subject','wphub_shipment_partial_order_subject');
    function wphub_shipment_partial_order_subject($subject){
    	return __('Your {site_title} order is shipped partially!','wxp-partial-shipment');
    }
  • ‘wphub_shipment_completed_order_heading’ : This filter can be used to modify email heading line for completed order email sent by Advance Partial Shipment Plugin.
    Example:

    add_filter('wphub_shipment_completed_order_heading','wphub_shipment_order_completed_heading');
    function wphub_shipment_order_completed_heading($heading){
    	return __('Your order is completed.','wxp-partial-shipment');
    }
  • ‘wphub_shipment_partially_order_heading’ : This filter can be used to modify email heading line for partially shipped order email sent by Advance Partial Shipment Plugin.
    Example:

    add_filter('wphub_shipment_partially_order_heading','wphub_shipment_partial_order_heading');
    function wphub_shipment_partial_order_heading($heading){
    	return __('Your order is shipped partially.','wxp-partial-shipment');
    }
  • ‘wphub_shipment_complete_status’ : This filter can be used to set custom order status when all order items are shipped fully and order is marked completed by Advance Partial Shipment Plugin.
    Example:

    add_filter('wphub_shipment_complete_status','wphub_shipment_complete');
    function wphub_shipment_complete($status){
    	return 'your-custom-status';
    }
  • ‘wphub_shipment_tracking_providers’ : This filter can be used to modify default shipment providers list available inside Advance Partial Shipment Plugin. you must have to use country code as key in provider list array.
    Example:

    add_filter('wphub_shipment_tracking_providers','wphub_shipment_providers');
    function wphub_shipment_providers($providers){
    	$providers = array(
    		'US' => array(
    			'Fedex'         => 'https://www.fedex.com/apps/fedextrack/?action=track&action=track&tracknumbers=%1$s',
    			'FedEx Sameday' => 'https://www.fedexsameday.com/fdx_dotracking_ua.aspx?tracknum=%1$s',
    		),
    		'AU'      => array(
    			'Australia Post'   => 'https://auspost.com.au/mypost/track/#/details/%1$s',
    			'Fastway Couriers' => 'https://www.fastway.com.au/tools/track/?l=%1$s',
    		),
    	);
    
    	return $providers;
    }
  • JSON/CURL API Example Code, you can find the same inside plugin directory “wphub-partial-shipment/api-example/”
    //CURL Request Example to get and update order data
    function sc_curl_post_req($url,$data){
    	$curl = curl_init();
    	curl_setopt($curl,CURLOPT_URL,$url);
    	curl_setopt($curl,CURLOPT_POST,true);
    	curl_setopt($curl,CURLOPT_POSTFIELDS,http_build_query($data));
    	curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
    	$result = curl_exec($curl);
    	curl_close($curl);
    	return json_decode($result,true);
    }
    
    $data = array(
    	'order-id'=>1009,
    	'tracking_url'=>'https://tracking-site.com/track/', // Tracking URL
    	'tracking_num'=>'ABCXYZ134545', // Tracking Number
    	'items'=>array( // Shipped items in current shipment
    		array(
    			'sku'=>'SK01',  // Shipped item  SKU
    			'qty'=>1,        // Shipped item Qty
    		),
    		array(
    			'sku'=>'SK02',
    			'qty'=>1,
    		),
    	)
    );
    
    $url = 'https://your-site.com/wp-json/wxp-shipment-data/wxp-data/?key=44a298073f287782f48c6bd01bdcb5dd&action=update';
    //action=update if action parameter passed in URL, it will create new shipment on every request
    //if "action=update" removed from URL then it will return all existing shipment array and won't create any new shipment
    
    
    $json = sc_curl_post_req($url,$data);
    print_r($json);