Function to recalculate shipping costs on subscriptions after renewal with Automatewoo

I’ve got a funky plugin that was custom made that adds a new random product from a group that a customer subscribes to.

Problem is, that the shipping doesn’t change depending on which product is selected, it stays with whatever was chosen initially.

Rather than paying more money to redevelop something that might already exist, is there any code that will recalculate shipping costs based on the item in the subscription? I have automatewoo, so could use a custom function from that and run it after a subscription payment has completed, I just don’t know how to code it.

Any support appreciated!


T-shirt and Accessories using POD drop shipping

Why are you selling this site?
I started this project but I have too many shirt businesses on my back burner so I'm letting someone else take this business and make it big

How is it monetized?
by selling print on demand items

Does this site come with any social media accounts?
no, it does not have a social presence

How much time does this site take to run?
takes 20-30 minutes to add a few items and publish them to the site. I can help the new owner with a…

T-shirt and Accessories using POD drop shipping

How to display a simulator for shipping rate by size, weight and location on the frontpage?

I would like to know if there is a plugin I can use to display a simulator on the frontpage. In my platform, I just take care of forwarding packages that my clients have already purchased on other platforms that doesn’t deliver to them (outside the us). I need to give my clients a quote (on the frontpage), based on size, weight and address, so they know much they should pay if they use my service. Currently, I use UPS for the delivery. I think the plugin should use an api call so I can get the correct price (negotiated price UPS), add my marge and give the quote. I hope I am understandable.

Thank you very much for your help

Pls how do I setup a from and to address and allow my UPS integrated solution calculate shipping based off the two addresses? [closed]

So, I am setting up a website to handle shipping services similar to DHL and UPS, but I am also using UPS services to handle the shipping cost through their API to my specific users, and I want to be able to calculate shipping by allowing users to enter a from and to shipping address, and calculate the shipping based on the distance. Any help would be much appreciated.

Polylang translate shipping label

I have shipping labels that I define in woocommerce settings, but I’m using multi language website, so the labels are irrelevant for my secondary language.

Right now it’s looking like that on my shipping methods: enter image description here

<?php   if (get_locale() == 'en_US') {       echo "shipping";   }   else{       echo "משלוח";   } ?>  

this is an example of how I translate most of my text fields, but I can’t reach the shipping label filter and use the code above.

How can I translate the shipping label using woocommerce filters?

Show/Hide specific shipping methods based on postcode and cart subtotal

I would like to show or hide specific shipping options based on postcode and cart subtotal amount. Here is my code:

add_filter( 'woocommerce_package_rates', 'unset_shipping_when_free_is_available', 10, 2 );     function unset_shipping_when_free_is_available( $  rates, $  package ) {      $  excluded_postcode = array( 1000,1030,1040,1050,1060,1070,1080,1081,1082,1083,1090,1140,1150,1160,1170,1180,1190,1200,1210 );     if(WC()->cart->get_cart_subtotal() >= '50' && !in_array(WC()->customer->get_shipping_postcode(), $  excluded_postcode )){         if ( isset( $  rates['free_shipping:4'] ) ) {             unset( $  rates['flat_rate:2'] );             unset( $  rates['flat_rate:26'] );             unset( $  rates['flat_rate:27'] );         }     }elseif(WC()->cart->get_cart_subtotal() >= '50' && in_array(WC()->customer->get_shipping_postcode(), $  excluded_postcode )){         if ( isset( $  rates['free_shipping:16'] ) ) {             unset( $  rates['flat_rate:13'] );             unset( $  rates['flat_rate:28'] );             unset( $  rates['flat_rate:29'] );         }     }     return $  rates; } 

What I want to do is when the customer’s postcode meets one of the list: array $ excluded_postcode(Brussels’s postcode), there will be 2 options: free collective shipping(free_shipping:16) (the customer need to choose a date) or flat rate based on weight, but if the cart subtotal is >=50€, then the shipping fee will be free, there will be also 2 options (both free), one is free collective shipping (need to choose a date) and the other is free shipping when the minimum amount is 50€(free_shipping:4); if the customer’s postcode is different from the array (not from Brussels), the shipping rate is based on weight, but if the subtotal amount is >=50€, then it will be free shipping. So if subtotal greater or equals 50€, only free options will be shown (if postcode=Brussels, 2 free shipping options: free_shipping:4 and free_shipping:16, if not Brussels: only free_shipping:4), if subtotal less than 50€, 2 options if Brussels: free_shipping:16 and flat rate based on weight, if not Brussels: only flat rate based on weight. (Brussels flat rates: flat_rate:2=0-2kg, flat_rate:26=2-5kg, flat_rate:27=5-10kg, No Brussels flat rates: flat_rate:13=0-2kg, flat_rate:28=2-5kg, flat_rate:29=5-10kg)

It works fine except when the subtotal is less than 50€ and from Brussels, only one free shipping option is showing: free_shipping:16, I would like to have both free options to be displayed.

This is the checkout page:

I would be greatful if you could help me with this, thank you!

how to allow user select shipping location(a custom locations dropdown) in checkout and recalculate values woocommerce

i need to know 2 things

  1. how do i add custom shipping zones to a determinate contry (I need to add some neightbours of a main city)
  2. How do i allow users to select the shipping zone when chekout or in the cart, and recalculate the total

Changing shipping cost in Woocommerce

I am creating a plugin that connects to an 3rd API to request the shipping cost based on the address of the person and the dimensions of the product.

Everything is fine but now I need the values ​​returned by the API to be added to the prices of the shipping methods and I tried with this code but it still doesn’t work.

add_filter('woocommerce_package_rates','test_overwrite_',100,2); function test_overwrite_($  rates,$  package) {  foreach ($  rates as $  rate) {  //Set the price $  rate->cost = $  phpVar1;   <-//variable that receives the value of the shipment }  return $  rates; } 

But I don’t find any way to change the shipping cost with functions..

Is it possible ? Thanks

How to create another shipping method which based on the previous shipping method

I have two shipping methods,

  • Standard
  • Express

Standard shipping method will be calculated based on the items amount and other data. In the express shipping method, I just want to add x amount. Let say if the standard shipping is 50 then it will be increased in the express 52. and if it is 60 then it will be 62. So basically increase the express shipping cost by adding 2 to standard shipping cost.

How this can be done?