Last active
April 28, 2019 17:53
-
-
Save woogist/6380491 to your computer and use it in GitHub Desktop.
WooCommerce Measurement Price Calculator custom unit convert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wc_measurement_price_calculator_conversion_table', 'wc_measurement_price_calculator_conversion_table' ); | |
/** | |
* This converts standard units to all other compatible units | |
*/ | |
function wc_measurement_price_calculator_conversion_table( $conversion_table ) { | |
// 1 ft = 1/18228.3465 leagues | |
$conversion_table['ft']['league'] = array( 'factor' => 18228.3465, 'inverse' => true ); | |
// 1 m = 0.000179985601 leagues | |
$conversion_table['m']['league'] = array( 'factor' => 0.000179985601 ); | |
return $conversion_table; | |
} |
Put this in functions.php
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
Hello,
got a question for this. Where should i put this in order for it to work?
Greetz and many thanks,
Casper