My Account: Always Apply Changes to Shipping Address to All Scheduled Orders

Enforce changes customers make to their Shipping Address within My Account > Addresses to always apply the Shipping Address change to all Scheduled Orders.

Important: Always test customizations to your site on a staging environment before making changes to your live / production site.  If you are not experienced with testing changes on a staging site, here is a good article to review.

/**
* Always apply shipping address changes to all scheduled orders.
* @param bool $enable True if apply to all else false.
* @param int $id The current user's id.
* @return bool The filtered value.
*/
function xx_always_apply_to_scheduled_orders( $enable, $id ){

  // Always apply changes to Shipping address to all scheduled orders.
  return true;
}
add_filter( 'autoship_apply_to_scheduled_orders_by_default', 'xx_always_apply_to_scheduled_orders', 10, 2 );

Still need help? Contact Us Contact Us