• Resolved globalimageusa

    (@globalimageusa)


    Hi Support,

    We have been using Shipstation for a while with Opencart but now created a new WooCommerce store. We have an issue where ShipStation updates the order in WooCOmmerce as Shipped when the label is created BUT doesn’t transfer over the meta data for tracking number, carrier and shipped date. We use Advanced Shipment Tracking for WooCommerce to insert the tracking information on the My Account page and in Emails.

    We have added the code recommeneded by Advanced Shipment Tracking for WooCommerce developers however no meta data is being transferred and recieved this reply back from them:

    Hi, we gave an example of the code to change since the ShipStation plugin developer ((WooCommerce) is not willing to add compatibility in their plugin, I would suggest contacting the ShipStation plugin developer and ask to add compatibility.

    How do you recommend we get this work?

    Cheers

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

Viewing 15 replies - 1 through 15 (of 22 total)
  • Hi, we are the developers of the AST plugin, adding the compatibility is easy.
    We added instruction for users how to do it hard-coded on our docs (search for ShipStation)

    We will be happy to assist, let me know if you need any help.

    Thanks!

    Thread Starter globalimageusa

    (@globalimageusa)

    Hi Support,

    Could you please tell me if the how to improve the modification to the following file to enable the meta data for carrier, tracking number and shipped date to be able to pass to AST fields on the woocommerce order.

    https://drive.google.com/file/d/105GxKE5IvgJVviGMAO71-4uIuxCMza3J/view?usp=sharing

    Cheers
    Mark

    Chiming in here, hoping for a plugin update!

    Plugin Support Mike Straw

    (@mikestraw)

    Hi @globalimageusa ,

    It sounds like this is because of this bug in the plugin: https://github.com/woocommerce/woocommerce-shipstation/issues/147

    Does that match up with what you’re seeing? If so, we can add this to the report, and possibly use @zorem ‘s code as a base for a fix (our developers can check, or – since it’s open source – a Pull Request could be submitted by anyone).

    Let us know!

    Thread Starter globalimageusa

    (@globalimageusa)

    Hi Mike,

    I’m not the greatest technical guy here.
    But if the developers can look into getting these 2 plugins to work together that would be ideal from my end. Starting with zorem’s code is a good point as some of their users have made it work. Unfortunately I haven’t been able to.
    The request of the meta data: Tracking Number, Carrier & Shipped date have to be performed prior to the order being maerked “SHIPPED” otherwise that information will miss the boat and not appear on the Shipped (Completed) order email.

    Any help appreciated.

    Plugin Support Mike Straw

    (@mikestraw)

    Hi @globalimageusa ,

    To clarify my previous comment, I think the two plugins should work together, but the bug I linked to may be preventing it.

    @zorem would you be able to confirm if fixing that bug would make things work properly for AST? If so, we can add these details to the bug report so it can help move towards a fix.

    Hi, the bug link is broken, anyway, I am not sure about Shipstation bugs.

    Its easy to add compatibility to AST

    Option one – add a hook we can use when you get the tracking info from Shipstation before you mark the order as Completed(Shipped) and we can provide the users with a code snippet to use in functions.php

    Option 2 – Add native compatibility in the same place to add compatibility with the official WC shipment tracking plugin and use the code we have on our docs and this will save users the need of adding the code snippet.
    Search for ShipStation on this page:
    https://www.zorem.com/docs/woocommerce-advanced-shipment-tracking/compatibility/

    Thanks.

    Thread Starter globalimageusa

    (@globalimageusa)

    Hi,

    Great to see you guys discussing this!
    We are launching our new site October 4th 2020, is there any chance this could be solved prior to then? That would be a lifesaver.

    Cheers
    Mark

    Plugin Support Mike Straw

    (@mikestraw)

    My apologies, I didn’t catch that this particular repo isn’t open. I’m going to add the details of this post to that report.

    ShipStation updates the order metadata with the tracking information, which can then be picked up by AST or any other extension. The catch, though (and the gist of the bug), is that the metadata is updated after the order status changes and the order-completed email is sent. The bug report is to reverse that order so that the shipment tracking information is available for the notification email.

    There’s also discussion on creating a hook for 3rd party tracking plugins to disable the default customer note as well and send tracking info to the customer in the preferred way by that plugin.

    @globalimageusa I can’t guarantee any timeline on this, but hopefully you can get that AST tweak to work for you!

    Thread Starter globalimageusa

    (@globalimageusa)

    Hi Guys,

    Finally some action!
    @mikestraw Thanks for getting this started.
    @zorem Please post the code to get this working as soon as available.

    Cheers
    Mark

    Hi Mike, This is correct, if you change the order of actions and add the hook for adding tracking before changing the order status we can provide the users code snippet to use to add the tracking to AST’s Shipment Tracking metadata fields.

    You mentioned that:

    ShipStation updates the order metadata with the tracking information, which can then be picked up by AST or any other extension.

    But this is not accurate since ShipStation checks if the official WooCommerce Shipment tracking is installed and only then adds the tracking to the shipment tracking metadata, otherwise its adds the tracking info to the order notes and only after that you provide the Hook: Trigger action for other integrations
    So if you move the Trigger action for other integrations we can use a code snippet and it will work

    This is how it set in the ShipStation file (class-wc-shipstation-api-shipnotify.php):

    
    // Tracking information - WC Shipment Tracking extension.
    		if ( class_exists( 'WC_Shipment_Tracking' ) ) {
    			if ( function_exists( 'wc_st_add_tracking_number' ) ) {
    				wc_st_add_tracking_number( $order_id, $tracking_number, strtolower( $carrier ), $timestamp );
    			} else {
    				// You're using Shipment Tracking < 1.4.0. Please update!
    				update_post_meta( $order_id, '_tracking_provider', strtolower( $carrier ) );
    				update_post_meta( $order_id, '_tracking_number', $tracking_number );
    				update_post_meta( $order_id, '_date_shipped', $timestamp );
    			}
    
    			$is_customer_note = 0;
    		} else {
    			$is_customer_note = 1;
    		}
    
    		$order->add_order_note( $order_note, $is_customer_note );
    
    		// Update order status.
    		if ( $order_shipped ) {
    			$order->update_status( WC_ShipStation_Integration::$shipped_status );
    
    			/* translators: 1) order ID 2) shipment status */
    			$this->log( sprintf( __( 'Updated order %1$s to status %2$s', 'woocommerce-shipstation' ), $order_id, WC_ShipStation_Integration::$shipped_status ) );
    		}
    
    		// Trigger action for other integrations.
    		do_action( 'woocommerce_shipstation_shipnotify', $order, array(
    			'tracking_number' => $tracking_number,
    			'carrier' => $carrier,
    			'ship_date' => $timestamp,
    			'xml' => $shipstation_xml,
    		) );
    
    • This reply was modified 4 years, 5 months ago by Zorem.
    Plugin Support Mike Straw

    (@mikestraw)

    Hi @zorem ,

    I misspoke on the specifics of how the extension processes the orders, but it is specifically that do_action( 'woocommerce_shipstation_shipnotify' that is being discussed.

    Edit to clarify: The issue is specifically moving that do_action to before the order status is updated.

    • This reply was modified 4 years, 5 months ago by Mike Straw.

    Yes, that option will allow us to provide users with a code snippet to add the tracking info to the shipment tracking metadata

    If you want to make life easier for these mutual users, you can add full compatibility by adding this code and they will not need to add additional code snippet:

    
    if ( class_exists( 'WC_Advanced_Shipment_Tracking_Actions' ) ) {
    	if ( function_exists( 'ast_insert_tracking_number' ) ) {
    		$status_shipped = 0;
    		ast_insert_tracking_number($order_id, $tracking_number, strtolower( $carrier ), $timestamp, $status_shipped);
    	}		
    }
    

    Thanks.

    Plugin Support Mike Straw

    (@mikestraw)

    Hi @zorem ,

    With so many plugins out there, it’s difficult to add all of them to our extensions. However, depending on the scope, it may be something our developers could consider adding. You may want to reach out to them on the WooCommerce Community Slack to see if that’s something that can be worked out.

    I’m going to go ahead and leave this thread open for now to work on the interim fix for @globalimageusa , but the integration and updates to the ShipStation extension itself should probably move over to our developer community.

    Thread Starter globalimageusa

    (@globalimageusa)

    Hi @mikestraw,

    We have only a week before launching the store, what is involved to get an interim fix?
    Otheriwse, I am either forced to delay the launch or look for alternative options.

    Cheers

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Compatibility With Advanced Shipment Tracking for WooCommerce’ is closed to new replies.