In commerce_pos.transaction.inc::commerce_pos_transaction_pay_submit(), there is logic to add a value to the line item's data:
if (module_exists('commerce_pos_stock')) {
$order = commerce_order_load($form_state['transaction']->orderId);
$order_wrapper = entity_metadata_wrapper('commerce_order', $order);
foreach ($order_wrapper->commerce_line_items->value() as $line_item) {
if (!empty($form_state['input']['return_line_items'][$line_item->line_item_id]['commerce_pos_stock_add_to_stock'])) {
$line_item->data['commerce_pos_stock_add_to_stock'] = $form_state['input']['return_line_items'][$line_item->line_item_id]['commerce_pos_stock_add_to_stock'];
commerce_line_item_save($line_item);
}
}
}
However, this is inside the block checking if the customer exists in the form state values:
if (!empty($form_state['values']['transaction_options']['customer'])) {
I'm not sure if the customer will always exist in the form state, but either way, the stock change shouldn't rely on it.
Comments
Comment #2
mbreden commentedPull request: https://github.com/AcroMedia/commerce_pos/pull/82
Comment #4
smccabe commented