Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save woogist/6380158 to your computer and use it in GitHub Desktop.
Save woogist/6380158 to your computer and use it in GitHub Desktop.
WooCommerce Measurement Price Calculator custom unit normalize
<?php
add_filter( 'wc_measurement_price_calculator_normalize_table', 'wc_measurement_price_calculator_normalize_table' );
/**
* Add conversions for any custom units to the appropriate standard unit
*/
function wc_measurement_price_calculator_normalize_table( $normalize_table ) {
// 1 league = 18,228.3465 ft
$normalize_table['league'] = array( 'factor' => 18228.3465, 'unit' => 'ft' );
return $normalize_table;
}
@matteoraggi
Copy link

In which folder of woocommerce 2.5.2 or of the plugin woocommerce-measurement-price-calculator I should insert the file wc-measurement-price-calculator-unit-normalize.php ?

@onebook0505
Copy link

Hi @bekarice,why woocommerce_area_unit is not working?

in measurement tab, if not enabled Calculated Price,how can i show the product dimensions in the cart?

WooCommerce version 3.5.7
WooCommerce Measurement Price Calculator version 3.14.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment