News:

Looking for documentation? Take a look on our wiki

Main Menu

VM3: display list of products with custom input in order/invoice

Started by carlos.martin, January 29, 2015, 13:06:39 PM

Previous topic - Next topic

carlos.martin

Good day

I'm currently working on an ecommerce site, and I'm mostly sold on using virtuemart 3 to build my shop. I've set up a testing site and so far it looks great!

However, there's one thing I'm not sure how to do: all of my productos have a custom input field (I've done this using the custom input plugin that comes with VM3), however I'd like the purchase order and the invoice to show each product with the content of the custom field, like this:

SKU   Product name   Custom Text
sku1  product1           Custom input 1
sku1  product1           Custom input 2

However, both the order and the invoice only show one line per product, and it doesn't show the custom input field.

Is there any way to do this? Thanks!

AH

Check that you do not have any overrides setup, from my testing, customfields show in orders and invoices.

this is the view that provides the customfields:-

components/com_virtuemart/views/invoice/tmpl/invoice_items.php

And this is the specific code


<td align="left" colspan="2" >
<div float="right" ><a href="<?php echo $product_link?>"><?php echo $item->order_item_name?></a></div>
<?php
//if (!empty($item->product_attribute)) {
if(!class_exists('VirtueMartModelCustomfields'))require(VMPATH_ADMIN.DS.'models'.DS.'customfields.php');
$product_attribute VirtueMartModelCustomfields::CustomsFieldOrderDisplay($item,'FE');
echo $product_attribute;
//}
?>

</td>
Regards
A

Joomla 4.4.5
php 8.1

carlos.martin

Good day

Thanks for your response. I've checked, however I don't think I have any overrides, since I'm using the default configuration of vm3 - I've only added the demo shop data, shipment and payment modules, and products, categories and custom fields.

I'm attaching a pdf of the order and the invoice, so you can see what's happening.

I've checked the lines of code in components/com_virtuemart/views/invoice/tmpl/invoice_items.php, and they are the same as in your post.

I'm not sure what could it be, is there any changes I should make in the invoice template?