I am creating a WordPress plugin that handles the shipping and delivery for WooCommerce.

I want to simply tell my WooCommerce cart (or order), this is what the shipping amount is.

I have tried directly setting WC()->cart->shipping_amount = $amount;,
and also doing ->add_fee( $shippingServiceName, $amount );
in both cases the shipping_amount on the cart remains at 0.

How do I set the shipping amount?

Read more here: How to programatically set the shipping amount in WooCommerce


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: