WPML

Overview of the Issue

In setups with Germanized for WooCommerce and WPML, there’s an issue where shipping methods that utilize Shipping Classes conditions are not available for translated products.

Workaround

This issue is fixed. Updating to the latest version solves it on your site, so you only need this workaround if you can’t update yet.

Please, make sure of having a full site backup of your site before proceeding.

  • Open …/wp-content/plugins/woocommerce-germanized/packages/woocommerce-germanized-shipments/src/ShippingMethod/ShippingMethod.php file.
  • Look for line 957.
  • Replace:
    $classes = isset( $condition['classes'] ) && ! empty( $condition['classes'] ) ? array_map( 'absint', (array) $condition['classes'] ) : array();
  • With:
    $classes = isset( $condition['classes'] ) && ! empty( $condition['classes'] ) ? array_map( 'absint', (array) $condition['classes'] ) : array();
    // compsupp-7583 workaround
    // Assuming $classes is an array of category IDs.
    $classes = array_map(function($class_id) {
    	// Translate each ID using WPML
    	return apply_filters('wpml_object_id', $class_id, 'category');
    }, $classes);

All known issues

Still Seeing This Issue?

If updating doesn’t fix it, ask a support question and we’ll look into it with you.