• Jordon Rupp

    (@jordonrupp)


    Howdy! It seems that the shipping rates are calculated based on the address in the General WooCommerce settings. They are not lining up with our ShipStation rates since we fulfill our shipments from an address that is different from our store address. Is there a filter or setting that can be utilized to calculate the rates based on our actual shipment address? Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Support IQComputing Alex

    (@iqcalex)

    Hello @jordonrupp

    We hope to implement ShipStation Warehouses soon, where you could set a global Warehouse on the Integration page, then override it per Shipping Zone. This would allow you to set the fulfillment addresses in ShipStation and the plugin would use those, then eventually fallback to the WooCommerce store address if needed.

    Disclaimer: We take no responsibility for any suggested custom development. Use any code or suggestions below entirely at your own risk.

    In the meantime, you may be able to use a combination of hooks to apply this kind of update. Our plugin uses WC()->countries->get_base_postcode() to pull in the Shipping Request address:

    'from_country_code'	 => WC()->countries->get_base_country(),
    'from_postal_code' => WC()->countries->get_base_postcode(),
    'from_city_locality' => WC()->countries->get_base_city(),
    'from_state_province'=> WC()->countries->get_base_state(),

    These values do have filter hooks like woocommerce_countries_base_postcode – You may see the full list of hooks below:

    https://woocommerce.github.io/code-reference/files/woocommerce-includes-class-wc-countries.html#source-view.250

    To ensure that these are temporarily changed (via filter hooks) you may use the following 2 action hooks to add and remove the Store Location filters:

    woocommerce_before_get_rates_for_packages and woocommerce_after_get_rates_for_packages

    These 2 action hooks run before and after the calculate_shipping() method is called on Shipping Methods.

    In theory, you would hook into the before – possibly check against the Shipping Method ID (Shipping method is passed as 2nd param) – and add_filter() for the updated store address values. Then, you could hook into the after and remove_filter() to ensure that it doesn’t affect anything else on your store.

    Hopefully this temporary measure works for you while we implement Warehouse support. If you have any questions, or run into any issues, please reply back to this topic and we can assist further. Have a wonderful rest of your week!

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.