Created
June 7, 2016 01:00
-
-
Save asalkey/408eac5ec9ad0292f986f1595280ad79 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
add_action( 'woocommerce_add_order_item_meta', array( &$this, 'add_esn_fields'), 10, 3 ); | |
public function add_esn_fields( $item_id, $values, $cart_item_key ) { | |
if($values['attached_id']){ | |
$x = 1; | |
while($x <= $values['quantity']) { | |
wc_add_order_item_meta( $item_id, 'esn', '', false ); | |
$x++; | |
} | |
}else if($values['type'] == 'wholesaler') { | |
$x = 1; | |
while($x <= $values['quantity']) { | |
wc_add_order_item_meta( $item_id, 'esn', '', false ); | |
$x++; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment