Streaming live at 10am (PST)

Custom Code Local Delivery Calculator

Hey guys,

Does anyone know if it’s possible to build your own custom code shipping calculator to input at checkout and add the shipping cost to the total?

I want to do this because a client needs a local distance based calculator because they deliver themselves but only in and around Metro Atlanta. It’s basically just $2/mi from their store to the destination with $10 minimum.

I’m mainly worried about it implementing smoothly with webflow. any ideas?

Here is my site Read-Only: LINK
(how to share your site Read-Only link)


Hey I think I have an idea.

I’m going to try building a distance calculator using google distance matrix api. From there if its less than 10 miles ill have it round up. between 10 and 20 and itll round up to 20.

From there I can make 15 products for shipping costs. so let’s say it’s 5 miles then it’ll go to a page where they can choose either free in-store pick up or $20 delivered to them (the 10mile shipping cost). Which ever they choose will be added to cart and I can hid the shipping options on the checkout page.

Still working on it, but ill post if it works!

1 Like

Hello David, I’m working on a similar solution, which also calculates my shipping externally, however, I am not managing to put this external value within the application, you could do this?

Hey Igor!

Give me like an hour and I’ll tell you everything I know!

Thanks David, I’m happy for your return.

Ok, so I ended up going the FoxyCart route. We found out that unless you can get into WebFlow’s back end to dynamically change the set price of shipping, then it wont work.

Even if you change the WebFlow give classes (only found on a published site in the inspector), it ties all shipping methods to the same class and ID so if you change either, they both change and you cant do anything about.

We tried :slight_smile:

SO with FoxyCart you can get everything moved over, it’s a little more complicated than they make it seem because some eCommerce things are unique to the business you’re building for. So I had email communication that eventually led to an online screen share call with someone at FoxyCart and helped me set up my eCommerce.

This way, you run your entire cart/checkout process through FoxyCart but manage all your products in WebFlow. So to get to the point, you also run your shipping prices and options through FoxyCart. You can create an option for set distances using Google Maps API (not sure if it needs the matrix or not, going to work on actually setting that up this weekend), and then you add your custom pricing that will be based off of the distance from the physical store location/address to the destination.

I’m not sure if you can set a cut off for like a delivery radius (that doesn’t allow//throws an error for deliveries past a certain distance from the store location). I’m also not sure if you can have a delivery radius cut off but allow specified cities/places outside of that radius. (Not sure if you’ll need that bit of info, but that’s what I’ll need for what I’m working on, so I thought maybe you would too).

SO, if you’re still trekkin’ with me, here is a brief sum-up:

• Is it possible to make this delivery/shipping cost calculator using a google maps api or google distance matrix api? YES! Can you use it in WebFlow? Nope :frowning:

• Do I have a solution? YES! Use FoxyCart, I’m trying it out and it seems that it’ll work great.
Pros for this: You get your shipping calculator, your checkout cart is going to be super customizable and super versatile, you save a little money.
Cons for this: You have to redo your eCommerce side (if it’s already set up), you’ll have to build out CMS Collections yourself to match what you would’ve used in your WebFlow eCommerce, and you’ll have to move or re-enter all of your products from your eCommerce product list over to your CMS Collections lists (this sucks for me because I have 600 cakes to re-enter :smiling_face_with_three_hearts: but maybe that’s not the case for you!)

So try it out! Think about it! I’m still working on it, but if you want to join me in this journey you know where my message box is.

Also heres the link to everything I just mentioned about FoxyCart (disclaimer, I haven’t read everything yet, BUT I had a verbal convo with Josh today and I understand the logistics behind it): v:2.0:shipping:custom_code:google_maps_distance [Foxy Wiki]