Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author algol.plus

    (@algolplus)

    hello

    Yes, I know about this limitation. We plan to fix it in version 2.0.

    What field do you try add exactly? I can provide small php code to fix the problem.
    thanks, alex

    Thread Starter swpshadley

    (@swpshadley)

    Hi Alex,

    Thanks for the reply. I’m trying to add a custom product attribute (“pa_unit_of_measure”).

    That would be great if you could post that code. Thanks.

    Plugin Author algol.plus

    (@algolplus)

    Could you try this code ?
    Please, add it to functions.php or use this plugin

    add_filter('woe_get_order_product_fields', 'woe_add_product_fields');
    function woe_add_product_fields($fields) {
    	$fields['unit_measure_2'] = array('label'=>'Unit Of Measure #2','colname'=>'Unit Of Measure #2','checked'=>1);
    	return $fields;
    }
    add_filter('woe_get_order_product_value_unit_measure_2','woe_fill_product_unit_measure_2', 10, 4);
    function woe_fill_product_unit_measure_2($value, $order, $item, $product) {
    	$field = "pa_unit_of_measure";
    	// variation or simple product ?
    	return isset($item[$field ])? $item[$field ]: $product->get_attribute($field);
    }
    • This reply was modified 7 years, 11 months ago by algol.plus.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Only saves one field with same meta key’ is closed to new replies.