Support » Plugin: Advanced Shipment Tracking for WooCommerce » Auto upload tracking number to WooCommerce Shipping add-on

  • Resolved clonemykey

    (@clonemykey)


    I was wondering if you could build in support for WooCommerce Shipping? Right now I print labels from inside my WooCommerce Order panel. I have two “Shipment Tracking” panels on the page — One for your plugin(AST) and one for the WooCommerce Shipping plugin. It would be nice if, once I print a label, your AST plugin automatically gets the tracking number instead of having to copy in paste.

    More info on the shipping I’m using https://docs.woocommerce.com/document/print-shipping-labels-woocommerce-shipping/

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author zorem

    (@zorem)

    Hi, sure, we are always want to add compatibility to shipping labels plugins, We need to contact the WooCommerce Shipping developers and ask for the Hook that they use to insert the tracking info to the order after the label is generated, then we can add a snippet that will add the tracking info to the shipment tracking meta fields (if it’s not doing that already), mark the order as shipped and work with all the other AST features.

    We will try to reach out to them and it will be great if you can also contact their support to ask for this hook.

    clonemykey

    (@clonemykey)

    This hook is inside the plugin and looks potentially relevant. Does this help?

    do_action( 'enqueue_wc_connect_script', 'wc-connect-create-shipping-label', $payload );

    ##Other stuff below for reference##

    $payload = array(
    				'orderId'            => $order_id,
    				'paperSize'          => $this->settings_store->get_preferred_paper_size(),
    				'formData'           => $this->get_form_data( $order ),
    				'labelsData'         => $this->settings_store->get_label_order_meta_data( $order_id ),
    				'storeOptions'       => $this->settings_store->get_store_options(),
    				//for backwards compatibility, still disable the country dropdown for calypso users with older plugin versions
    				'canChangeCountries' => true,
    			);
    • This reply was modified 2 months ago by clonemykey.

    Any update on this? We really want to use this plugin but it’s very tedious to copy and paste everything individually.

    Plugin Author zorem

    (@zorem)

    Hi, we will check how to add compatibility to the WC shipping, I will keep you posted.

    Plugin Author zorem

    (@zorem)

    Hi @clonemykey
    1. we opened a ticket with WC Shipping to add compatibility and I will update you when they respond.
    2. we checked the WooCommerce Shipping plugin and until they add compatibilty, you can override a template file in their plugin to add support to our plugin. see the instructions on our documentation (search for compatibility with WooComemrce Shipping section:
    https://www.zorem.com/docs/woocommerce-advanced-shipment-tracking/compatibility/
    Thanks.

    Hi Zorem,

    Thanks for this. The override code doesn’t fully push everything through. It’s not displaying properly. The tracking number gets put into the plugin field however it’s not showing up on the TrackShip Dashboard and shows the following error message on the customer facing tracking page

    “TRACKING # 123456789ABCD
    Tracking details not found in TrackShip”

    • This reply was modified 1 month, 1 week ago by clonemykey.
    Plugin Author zorem

    (@zorem)

    Hi, to send the tracking info for auto-track on TrackShip you must mark the order as shipped. you can do that programmatically:

    'status_shipped' => '1',

    status_shipped- Change order status to “Shipped” (completed) or “Partial Shipped” (if enabled) – 0=no, 1=shipped, 2=partial shipped.

    Thanks

    clonemykey

    (@clonemykey)

    Oh, interesting. I thought that was already done when the tracking number hit the AST plugin. Where in the code would be the best place to put this?

    public function update_label_order_meta_data( $order_id, $new_label_data ) {
    	$result = $new_label_data;
    	$labels_data = $this->get_label_order_meta_data( $order_id );
    	foreach( $labels_data as $index => $label_data ) {
    		if ( $label_data['label_id'] === $new_label_data->label_id ) {
    			$result = array_merge( $label_data, (array) $new_label_data );
    			$labels_data[ $index ] = $result;
    			if ( ! isset( $label_data['tracking'] )
    				&& isset( $result['tracking'] ) ) {
    					WC_Connect_Extension_Compatibility::on_new_tracking_number( $order_id, $result['carrier_id'], $result['tracking'] );
    					if ( is_plugin_active( 'woo-advanced-shipment-tracking/woocommerce-advanced-shipment-tracking.php' ) ) {
    						$wast = WC_Advanced_Shipment_Tracking_Actions::get_instance();
    						$args = array(
    							'tracking_provider'     => $result['carrier_id'],					
    							'tracking_number'       => $result['tracking']		
    						);
    						
    						$wast->add_tracking_item( $order_id, $args );					
    					}
    			}
    		}
    	}
    	update_post_meta( $order_id, 'wc_connect_labels', $labels_data );
    	return $result;
    }
    Plugin Author zorem

    (@zorem)

    We updated the code snippet on our docs to include the update the order status to Shipped.
    https://www.zorem.com/docs/woocommerce-advanced-shipment-tracking/compatibility/#compatibility-with-shipping-labels-plugins
    Thanks

    clonemykey

    (@clonemykey)

    Perfect, initial test looks like this works as intended.

    Plugin Author zorem

    (@zorem)

    Great, if you like AST, please review the plugin 🙂

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