less than a minute read • Updated 8 minutes ago

Add Custom Shipping Code

Step by step: add custom shipping code to your store.


Overview

This article walks through adding custom shipping code to your store from the Foxy admin. For what custom shipping code can do and how it works, see Custom Shipping Code. For ready to use code, see Custom Shipping Code Examples.


Before you start

Custom shipping code runs for categories whose delivery type is set to "Shipped using live shipping rates." Make sure the categories you want to affect are set to that delivery type and have a default weight configured. You can set this up in the Categories section of your admin.


Steps

  1. 1

    In the Foxy admin, go to Settings and open the Shipping page.

  2. 2

    In the Shipping methods list, click Custom Shipping Code. It will show as "Inactive" until you add code.

  3. 3

    A New shipping method panel opens with a code editor labeled "Custom Code."

  4. 4

    Enter or paste your JavaScript into the editor. If you need help writing it you can reach out to the Foxy Support team.

  5. 5

    Click Create.

  6. 6

    Foxy deploys your code behind the scenes. This takes about 15 to 20 seconds. Once deployed, Custom Shipping Code will show as "Active" in the Shipping methods list.


Test your code

Add a product from an eligible category to your cart and proceed to checkout with a shipping address. Your custom rates should appear among the shipping options. If you don't see the rates you expect:

  • Confirm the product's category delivery type is "Shipped using live shipping rates."

  • Confirm the code was saved and deployment finished (the method shows "Active").

  • Check that your code adds at least one rate (or returns an error) for the address you're testing.


Edit or update your code

To change your code later, return to the Shipping page, click Custom Shipping Code again, edit the code, and Save. Each save triggers a fresh deployment.


Need Help?

Did this article answer your questions? Need help with anything? Please click below to contact us.