Steps to Reproduce the Issue
Error Log
Here is a related error from the WooCommerce error logs:
2025-01-17T17:53:59+00:00 NOTICE missing_upsdap_terms_of_service_acceptance The origin address needs to accept the UPS Terms and Conditions. (Automattic\WCShipping\LabelPurchase\LabelPurchaseService) CONTEXT: {"_legacy":true}
Temporary Solution
I have rolled back the WooCommerce Shipping plugin to v1.2.3 to restore functionality. However, this version does not include the UPS integration. I will not update until this issue is resolved.
Environment Details
WC Version: 9.5.2
Legacy REST API Package Version: The Legacy REST API plugin is not installed on this site.
Action Scheduler Version: 3.9.0
Log Directory Writable:
WP Version: 6.7.1
WP Multisite: –
WP Memory Limit: 768 MB
WP Debug Mode:
WP Cron: – (using server based PHP cron)
Language: en_US
External object cache: Server Environment
Server Info: Apache
PHP Version: 7.4.33
PHP Post Max Size: 256 MB
PHP Time Limit: 120
PHP Max Input Vars: 3000
cURL Version: 8.2.1
OpenSSL/3.1.4
Tim
]]>I have Four shipping methods. Ordinary, Fast Ordinary, Free Shipping, and Sensitive. All products should default to Ordinary with the choice of Fast Ordinary
For the Sensitive products, no other method should be allowed. Including free shipping.
For the ordinary products, the default (selected) should be Ordinary, and the option to select Fast Ordinary should be available.
For free shipping, Sensitive products are never eligible, but Ordinary products are once 200 dollars is in that basket.
So, let me sum it up:
Ordinary products default to Ordinary shipping with the option for Fast Ordinary. Free shipping only kicks in for Ordinary products once 200 dollars is reached. All shipping methods should be available (conditionally) except Sensitive shipping.
Sensitive products must only be allowed Sensitive shipping. Ordinary, Fast Ordinary, and Free shipping must never be an option.
Take a look at the screenshot to get an idea of where I’m up to.
Note: I have some custom code that splits up the cart using this function:
/**
* Set default shipping method for specific shipping classes in WooCommerce cart.
*/
function set_default_shipping_method_for_shipping_class( $rates, $package ) {
// Define an array of shipping class slugs for which you want to set the default method
$shipping_class_slugs = array(
'cjpacket-ordinary',
'cjpacket-fast-ordinary',
'flat-rate-shipping'
);
// Loop through cart items to check if any product belongs to the specified shipping classes
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
$shipping_class = $cart_item['data']->get_shipping_class();
// Check if the shipping class of the current item matches any of the defined shipping class slugs
if ( in_array( $shipping_class, $shipping_class_slugs ) ) {
// Loop through available shipping rates to set the default method
foreach ( $rates as $rate_key => $rate ) {
// Change 'flat_rate:1' with your desired shipping method ID
if ( 'flat_rate:1' === $rate_key ) { // Change 'flat_rate:1' to match your desired method
// Make this method the default selected
$rates[$rate_key]->set_taxes( WC_Tax::calc_shipping_tax( $rates[$rate_key]->cost, WC_Tax::get_shipping_tax_rates() ) );
$rates[$rate_key]->set_shipping_total( $rates[$rate_key]->cost );
$rates[$rate_key]->set_method_id( $rates[$rate_key]->method_id );
$rates[$rate_key]->set_instance_id( $rates[$rate_key]->instance_id );
$rates[$rate_key]->set_label( $rates[$rate_key]->label );
$rates[$rate_key]->set_cost( $rates[$rate_key]->cost );
$rates[$rate_key]->set_id( $rates[$rate_key]->id );
$rates[$rate_key]->set_package_id( $rates[$rate_key]->package_id );
$rates[$rate_key]->set_meta_data( $rates[$rate_key]->meta_data );
$rates[$rate_key]->set_method_title( $rates[$rate_key]->method_title );
break; // Stop the loop after setting the default method
}
}
break; // Stop the loop after finding the specified shipping class
}
}
return $rates;
}
add_filter( 'woocommerce_package_rates', 'set_default_shipping_method_for_shipping_class', 10, 2 );
add_filter( 'woocommerce_cart_shipping_packages', 'bbloomer_split_shipping_packages_by_class' );
function bbloomer_split_shipping_packages_by_class( $packages ) {
$destination = $packages[0]['destination'];
$user = $packages[0]['user'];
$applied_coupons = $packages[0]['applied_coupons'];
$packages = array();
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
$key = $cart_item['data']->get_shipping_class_id();
$packages[$key]['contents'][$cart_item_key] = $cart_item;
}
foreach ( $packages as $index => $package ) {
$total = array_sum( wp_list_pluck( $packages[$index]['contents'], 'line_total' ) );
$packages[$index]['destination'] = $destination;
$packages[$index]['user'] = $user;
$packages[$index]['applied_coupons'] = $applied_coupons;
$packages[$index]['contents_cost'] = $total;
}
return $packages;
}
It seems my shipping classes are begin totally ignored and I don’t know how to fill the other conditions, such as hiding/showing/default selecting various shipping methods based on shipping classes assigned to a product.
Your help is greatly appreciated. Suggestions for reasonably priced plugins (<$100) are welcome.
Thanks
]]>[29-May-2024 18:45:22 UTC] PHP Fatal error: Uncaught InvalidArgumentException: PayPal order ID not found in meta. in <REDACTED>/wp-content/plugins/woocommerce-paypal-payments/api/order-functions.php:38
Stack trace:
#0 <REDACTED>/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-order-tracking/src/Integration/WcShippingTaxIntegration.php(104): WooCommerce\PayPalCommerce\Api\ppcp_get_paypal_order()
#1 <REDACTED>/wp-includes/class-wp-hook.php(324): WooCommerce\PayPalCommerce\OrderTracking\Integration\WcShippingTaxIntegration->WooCommerce\PayPalCommerce\OrderTracking\Integration\{closure}()
#2 <REDACTED>/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#3 <REDACTED>/wp-includes/rest-api/class-wp-rest-server.php(462): apply_filters()
#4 <REDACTED>/wp-includes/rest-api.php(428): WP_REST_Server->serve_request()
#5 <REDACTED>/wp-includes/class-wp-hook.php(324): rest_api_loaded()
#6 <REDACTED>/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#7 <REDACTED>/wp-includes/plugin.php(565): WP_Hook->do_action()
#8 <REDACTED>/wp-includes/class-wp.php(418): do_action_ref_array()
#9 <REDACTED>/wp-includes/class-wp.php(813): WP->parse_request()
#10 <REDACTED>/wp-includes/functions.php(1336): WP->main()
#11 <REDACTED>/wp-blog-header.php(16): wp()
#12 <REDACTED>/index.php(17): require('...')
#13 {main}
thrown in <REDACTED>/wp-content/plugins/woocommerce-paypal-payments/api/order-functions.php on line 38
So i disable the WooCommerce PayPal Payments plugin and my labels get generated with no issues.
Hopefully the right team can fix this
I have product variation by two system ( By Set / By Pallet )
I want to ship my products to 3 counties in the us with different delivery fee:
But, i have different sets for each product.
For Example In Dade County, if the customer’s order fills one pallet or less, regardless of the number of sets, the delivery fee remains $25.
However, if the customer’s order exceeds one pallet’s worth, additional pallet fees apply at the corresponding rate
Here are some demo user info for your checking purpose:
Please help me out.
]]>