• Resolved scmsteve

    (@scmsteve)


    We have had issues where certain discounts/etc were showing up in ShipStation as line items. Given that we are using mandatory scan-to-verify this posed problems as those line items could not be verified.

    ShipStation support has not been very helpful, but in looking through the source code I do see a filter added in v4.1.31 2020-01-05:

    Add – Filter woocommerce_shipstation_no_shipping_item for when an item does not need shipping or is a fee.

    It seems that writing a quick plugin to simply return true here based on the first argument which is the AND of “! $product || ! $product->needs_shipping()” and “‘fee’ !== $item[‘type’]”. In our case, the discount line items should not be a product or needs shipping, and they are type fee so this should return true, and our filter could return that value and thus exclude the discount/fee items.

    Can you confirm?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter scmsteve

    (@scmsteve)

    Actually, I mis-read, it is allowing non-shipping items through *if* they are a fee I believe.

    I tested with this:

    function  my_shipstation_no_shipping_item( $no_ship_not_a_fee, $product, $item ) {     
            if ( 'fee' == $item['type'] ) {
                    return true;
            }
    }
    add_filter( 'woocommerce_shipstation_no_shipping_item', 'my_shipstation_no_shipping_item', 10, 3 );
    

    And it does seem to prevent fee items from being exported which is what we are looking for.

    Tested with using the API call as documented on the plugin page to see the results ShipStation would get:

    https://testsite.simplycharlottemason.com/?wc-api=wc_shipstation&auth_key=WCSS-3997b8e89f4c6637196deb60260574c4&action=export&start_date=06/22/2021T16:57:00&end_date=06/22/2021T16:59:00

    [Note: dates are GMT, time seems to be ignored entirely, and uses pagination]

    • This reply was modified 3 years, 6 months ago by scmsteve.
    Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    I took a look at woocommerce-shipstation/includes/api-requests/class-wc-shipstation-api-export.php where the filter is located.

    Actually, I mis-read, it is allowing non-shipping items through *if* they are a fee I believe.

    The request() function is massive and testing the output is probably the best (and only) way to understand what the filter is doing.

    And it does seem to prevent fee items from being exported which is what we are looking for.

    Nice sleuthing ??.

    Kind regards,

    Plugin Support Sol J. a11n

    (@solstudioim)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if you’re still having the issue

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Document filter `woocommerce_shipstation_no_shipping_item`’ is closed to new replies.