Shipping Fees

Since launching my site last year, all shipping was calculated as flat rate: $0 (hence: free!). The majority of orders I receive are local and therefore are relatively inexpensive in regards to shipping. What I would like to do moving forward is charge a flat rate shipping fee of $4.99 to any orders that are shipped outside the state of Ohio. Can this be done with the 2.0 cart? If so, could you tell me how, my knowledge is pretty basic when it comes to implementing these things. Thank you!
Comments
  • fc_adamfc_adam FoxyCart Team
    @mboarman,

    You'd want to implement the following snippet: https://wiki.foxycart.com/v/2.0/snippets/flat_rate_shipping_modification

    When it asks for the custom logic, add this:
    if (address.region == "OH") {
    FC.customFlatRates.add(1, 4.99, '', 'Flat Rate Shipping');
    } else {
    FC.customFlatRates.add(2, 0, '', 'Free Shipping');
    }
  • Thanks for the replay. I copied the Javascript provided in "step 2" of the link and to the end of the "Cart Include" template. I than added the custom logic in the marked section and changed the autoselect config to true. It added the shipping options to the cart no matter what state I choose it comes back with "Free shipping".

    My website: kentclothingco.com

    Any help would be appreciated! Thanks!
  • fc_jedfc_jed FoxyCart Team
    @mboarman

    What you'd want to do is to change the condition from (address.region == "OH") to (address.region != "OH")
  • After changing that condition it now charges the flat rate shipping in Ohio and all other states. Just the opposite of what it was going before? Am I doing something wrong?
  • fc_jedfc_jed FoxyCart Team
    @mboarman

    Oh, sorry about that. I meant to write replace the current condition with (address.state != "OH") instead. Sorry for the small confusion there.
  • fc_adamfc_adam FoxyCart Team
    @mboarman,

    I'm sorry for getting that the wrong way around in my initial post!
  • Perfect! It worked! Thank you gentlemen! Much appreciated!
  • fc_jedfc_jed FoxyCart Team
    @mboarman

    You're welcome! Let us know if you run into additional concerns.
Sign In or Register to comment.