Shipping Costs per Item Count on WooCommerce (Free)

Jun 13, 2019 | Desarrollo Web, eCommerce

Recently I came about a problem for a WooCommerce site I was working on. My client wanted to charge a cheaper rate the more items were purchased. In this post, I will guide you through the steps you need to take to achieve this.

Digging through the internet I found an article that shed some light onto me on the matter. For a section of the article, the writer talked about Flat Rate Settings, and how one can use them to multiply a flat rate by the number of items purchased using the [qty] shortcode.

WooCommerce Flat Rate Settings

This was, however, unsatisfactory, as it was only a linear scaling of the shipping cost. I noticed the use of the ‘*’ operator and wondered if I could do a bit more complex math than as advertised. *SPOILER ALERT*: yes, I could.

So I went on https://mycurvefit.com/ to

(1) Plot Estimated Shipping-Costs on a graph.

image.png
MyCurveFit.com Item Count (X) vs. Shipping Cost (Y)

MyCurveFit.com is easy to use and pretty self-explanatory. This amazing site gave me a myriad of function options trying to fit the plots. Linear was no use to me, but Polynomial and Nonlinear functions were close to what I needed.

(2) Select a Function

MyCurveFit.com function options

Ultimately I decided to go with a Power Function because even though the polynomials were more accurate, I wanted to make this as simple as possible for the Flat Cost input field.

image.png
Power Function as graphed by MyCurveFit.com

Now all I needed to do was

(3) Input Function into WooCommerce Flat Rate Cost Settings

and see if this would actually work.

Power Function for Shipping Costs

The function ended up performing as expected, and my client saved a few-dozen dollars.

Because we are using a function, this operation scales infinitely. This can be a big positive or negative depending on your project.

Checkout Snapshot

Carrying out these steps immediately impacts me as a great way to utilize the most out of WooCommerce’s free capabilities. Knowing how to apply functions can be an extremely effective tool. My client is left very satisfied with the ability to further define the plot-points and chose the function himself.

Comparte esto

Artículos Relacionados

Cómo usar la mejor herramienta para hacer gradientes con CSS

Aprende a usar CSSGradient.io para crear hermosos gradientes CSS. Una guía paso a paso para diseñadores y desarrolladores web.

Comparte esto

Internal Link Juicer: Básico para tu WordPress

Tabla de Contenidos¿Qué es Internal Link Juicer?Beneficios de Usar Internal...

Siteground: El Mejor Proveedor de Hosting que he Encontrado

Descubre por qué SiteGround es el mejor proveedor de hosting: rendimiento superior, soporte excepcional y seguridad inigualable.

Comparte esto

Cómo usar IndexNow en tu WordPress y mejorar tu SEO

Descubre cómo mejorar tu SEO en WordPress con IndexNow: integración fácil, actualización instantánea y visibilidad mejorada.

Comparte esto

Invertir en Crypto es una Estupidez

El auge de las criptomonedas prometía una revolución financiera, ofreciendo un...