News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

How to display Product MPN on Invoice Details

Started by role74, December 20, 2014, 15:12:02 PM

Previous topic - Next topic

role74

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

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

AH

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

Regards
A

Joomla 3.10.11
php 8.0

role74

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?

AH

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!)
Regards
A

Joomla 3.10.11
php 8.0

jenkinhill

#5
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.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

alin

It would be nice in the future to have it available in $vars['orderDetails']['items']