Hi !
I started adding multi-inventory to certain products because I have several storage locations.
Until now, I'm use this snippet code to display product location to Shipping and picking list.
This works on non-multi-inventory products but does not retrieve information when multi-inventory is activated.
<?php
$locations = wp_get_object_terms ( $summary_item, 'atum_location', array( 'fields' => 'names' ) );
$locations_list = ! empty( $locations ) ? implode( ', ', $locations ) : '–';
?>
<?php echo esc_html( $locations_list ) ?>
I tried to modify a code that works to retrieve the batch number and the BBF, but I can't manage to trace the stock locations :
`add_action( 'wpo_wcpdf_after_item_meta', 'wpo_wcpdf_show_product_lieu', 10, 3 );
function wpo_wcpdf_show_product_lieu ( $document_type, $item, $order ) {
$inv = \AtumMultiInventory\Models\Inventory::get_order_item_inventories( $item['item_id'] );
$inventory_id = $inv[0];
$inventory = \AtumMultiInventory\Inc\Helpers::get_inventory( $inventory_id->inventory_id );
$stock = $inventory->location;
if( !empty($stock ) )
{
echo esc_html( '<p class="lot" style="margin-top: 0!important;"><strong>Stock :</strong> '.$stock.'</p>');
}}`
I know that I am not far from having the right solution. Can you help me ?