Build Simple Custom Woocommerce Shipping Method

preview_player
Показать описание
In this tutorial we will create a simple shipping method for WooCommerce which will calculate the cost of shipping.

To follow this tutorial you will need: WordPress, WooCommerce plugin installed & activated plus your Editor of choice.

=============================================

Or purchasing through my Plugin Affiliate links:

I am social too:
-------------------------------------------------------------------------------
LEARN MORE IN THE WELL CURATED PLAYLISTS BELOW
--------------------------------------------------------------------------------

WooCommerce E-Commerce customizations

== Build Free Custom Theme for E-commerce Online Shop using WooCommerce -

====== Build Dynamic Websites with Elementor ======

====== How to use WordPress Gutenberg Block Editor ======

WordPress 5.4 Gutenberg Blocks Updates

WordPress Gutenberg blocks for Designers

Gutenberg WordPress Block Editor tutorials for beginners

Custom WooCommerce Gateway Development from Scratch

WordPress Custom REST API Namespaces, Endpoints and Examples from Scratch

====== WordPress Plugin Development from Scratch ======

Build Most Popular & Most Commented Post Plugin

Build SMS Plugin with External WordPress API Integration using custom WordPress Databases

WordPress External APIs Integration Plugin Development

Convert WordPress to mobile App in Headless WordPress

Make GraphQL API endpoints with WordPress Headless CMS WPGraphQL Plugin

Customize Your WordPress & ClassicPress

Custom Dashboard Widgets

Build Custom Admin

Learn Git
Рекомендации по теме
Комментарии
Автор

calculate_shipping( $package ) calculate_shipping($package = array())

iandoucett
Автор

Wow, you simply gave us a full lesson creating a new plugin for wordpress and have it integrated in our shipping methods. Thank you.

GoTechUG
Автор

I need to add a custom shipping carrier to woocommerce (if possible), would I be able to pull that off with what's offered in this video? thanks!

jkatman
Автор

Hey, Nice explaining here. really easy to understand. Hard to find content some things in wordpress.

madhawapiumika
Автор

Hello,

Thank you for your tutorial and actionable code snippet.
As of now (03/2024), you need to replace on line 38 :

public function calculate_shipping( $package) {
by
public function calculate_shipping( $package = []) {


Otherwise it throws a fatal error (at least in my case).

elcondorito
Автор

thanks! it works great
Do you know if its possible to put two or more shipping options whit this method?

miguelcarranza
Автор

Hi, thanks for sharing this great tutorial. I have a question. Can I add a condition to determine the cost? I want to add a condition involving address 2 in woocommerce. I've changed the address 2 textfield to a dropdown field so I've made the choice for address 2. I have two options for address 2 namely 'A' and 'B'. I want to determine the cost for 'A' and 'B' respectively. I added the following code to the example you shared

$rate = array(
'label' => $this->title,

if ($address_2=='A'){ 'cost' => '7000';
}else{
'cost' => '2000';},
'calc_tax' => 'per_item'
);

but i get an error like this

syntax error, unexpected 'if' (T_IF), expecting ')'

ariria
Автор

Fantastic video! I am trying to use your example to implement an insured postage method via this method. Is there a way to modify the shipping cost to make it:

$10.99 + (CEIL([price of goods in cart], rounded to nearest increment of 100] - 100) * 2%

i.e.
price of goods is $50 ---> Insured Shipping = $10.99
price of goods is $101 ---> Insured Shipping. = $12.99
price of goods is $201 ----> Insured Shipping = $14.99

If so how would you go about implementing it? Thanks so much :)

benredjepi
Автор

Nice Sir, How to Make COD extra fee plugin

itsanamulhaque
Автор

*TechiePress* bro please upload thirdparty api integration in wordpress like wearther app, payment gateway etc

russellazim
Автор

would you like to make a video on
order conformation user gets a sms on his mobile ? answer my questions please

androidadvancetutorialsser
Автор

Please make a video on woocommerce api and integration with other

androidadvancetutorialsser