/** | |
* This adds the new unit to the WooCommerce admin | |
*/ | |
function add_woocommerce_dimension_unit_league( $settings ) { | |
foreach ( $settings as &$setting ) { | |
if ( 'woocommerce_dimension_unit' == $setting['id'] ) { | |
$setting['options']['league'] = __( 'league' ); // new unit | |
} | |
} | |
return $settings; | |
} | |
add_filter( 'woocommerce_products_general_settings', 'add_woocommerce_dimension_unit_league' ); |
This comment has been minimized.
This comment has been minimized.
Im a bit confused, with Matteoraggi with this one. I've tried putting it in theme function.php and that didn't seem to work |
This comment has been minimized.
This comment has been minimized.
So, I ran into the same problem mentioned above. I followed example listed on the woocommerce development site (https://docs.woocommerce.com/document/woocommerce-measurement-price-calculator-developer-documentation/), but to no avail. However, when I forced it into the array by calling the
I'm a bit confused why this is the case because there are plenty of times that I can remember where I've looped through the array and set the new value using the 'current instance' of the loop, but I guess not this time. I'm not sure if it's a php version difference, but in any case, this worked for me. I hope this helps! |
This comment has been minimized.
This comment has been minimized.
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 |
This comment has been minimized.
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-custom-unit.php ?