You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the setting WooCommerce->Settings->Shipping->Shipping options->Enable debug mode is enabled, then a bar with the matching shipping zone is shown during checkout and caching is disabled.
We should show how we calculated the shipping prices there as well. We are already showing how we calculate the shipping price in the error log, but it would be nice to show it there.
The text was updated successfully, but these errors were encountered:
/** * Loads all shipping methods which are hooked in. * If a $package is passed some methods may add themselves conditionally and zones will be used. * * @param array $package Package information. * @return WC_Shipping_Method[] */publicfunction load_shipping_methods( $package = array() ) {
if ( ! empty( $package ) ) {
$debug_mode = 'yes' === get_option( 'woocommerce_shipping_debug_mode', 'no' );
$shipping_zone = WC_Shipping_Zones::get_zone_matching_package( $package );
$this->shipping_methods = $shipping_zone->get_shipping_methods( true );
// Debug output.if ( $debug_mode && ! defined( 'WOOCOMMERCE_CHECKOUT' ) && ! defined( 'WC_DOING_AJAX' ) && ! wc_has_notice( 'Customer matched zone "' . $shipping_zone->get_zone_name() . '"' ) ) {
wc_add_notice( 'Customer matched zone "' . $shipping_zone->get_zone_name() . '"' );
}
} else {
....
So when we add something to the log, then we can simply also add it using wc_add_notice() if the debug setting is enabled and then reuse the check they have:
$debug_mode = ('yes' === get_option( 'woocommerce_shipping_debug_mode', 'no' ));
if ( $debug_mode && ! defined( 'WOOCOMMERCE_CHECKOUT' ) && ! defined( 'WC_DOING_AJAX' ) ) {
wc_add_notice($ss_log_entry);//This is where we add the log entry
}
If the setting WooCommerce->Settings->Shipping->Shipping options->Enable debug mode is enabled, then a bar with the matching shipping zone is shown during checkout and caching is disabled.
We should show how we calculated the shipping prices there as well. We are already showing how we calculate the shipping price in the error log, but it would be nice to show it there.
The text was updated successfully, but these errors were encountered: