Hi There
I'm quite OK in html coding, but not too good in php :-)
I'm currently using Virtuemart 2.6.10
I would like to display the product MPN (Manufacturer Part Number) in the invoice details.
As far that I know it's in the invoice_items.php and there I see from line 57 the correct position:
<tr valign="top">
<td align="left">
<?php echo $item->order_item_sku; ?>
here's the expected position in the code for the MPN (no matter about the formatting, I get it done ;D
</td>
<td align="left" colspan="2" >
<div float="right" ><a href="<?php echo $product_link; ?>"><?php echo $item->order_item_name; ?></a></div>
<?php echo $item->order_item_mpn; ?> doesn't work.
Can anybody tell me the correct line of code to insert in order to get the products MPN displayed next to the SKU?
Thanks alot!
-roland
As a guess, try product_mpn
product_mpn is not stored in the order item detail table
The order query uses this info for the order lines
db virtuemart_order_items does not store this field - only SKU
So trying to just use the variable name product_mpn will not deliver any results
Quote from: Hutson on December 20, 2014, 19:39:41 PM
So trying to just use the variable name product_mpn will not deliver any results
...and what does finally deliver a result?
nothing does deliver it.
It is not in the table of order details and is not available to the order without some core customisation (not just a template change!)
You would have to write a query to pull the product_mpn from the ##_virtuemart_products table in the database. Best way would be to write a plugin rather than a core hack.
I use product_mpn in product details page by just putting echo $this->product->product_mpn; into an override. I actually had not noticed that GTIN (ISBN) or MPN were not included in the orders table.
It would be nice in the future to have it available in $vars['orderDetails']['items']