VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: kiwee on November 17, 2016, 12:30:48 PM

Title: display order custom fields anywhere
Post by: kiwee on November 17, 2016, 12:30:48 PM
Hi,

I have an order custom field (so display in "my order" detail for each products).

I need to display that custom field in a custom page (full PHP).

I thought about using :


$item['virtuemart_product_id']=$infoss->virtuemart_product_id;
$item['product_attribute']=$infoss->product_attribute;
if(!class_exists('VirtueMartModelCustomfields')) {
   require(VMPATH_ADMIN.DS.'models'.DS.'customfields.php');
}
$product_attribute = VirtueMartModelCustomfields::CustomsFieldOrderDisplay($item,'FE');
echo $product_attribute;


But it doesn't work. Maybe I have to add more info in the $item ? Or maybe it is just impossible to use the VirtueMartModelCustomfields::CustomsFieldOrderDisplay anywhere else than in the order page ?

I'd appreciate any clue :)

Thanks !

Title: Re: display order custom fields anywhere
Post by: GJC Web Design on November 17, 2016, 13:52:52 PM
QuoteI have an order custom field

shopper field or custom field?

versions?
Title: Re: display order custom fields anywhere
Post by: kiwee on November 17, 2016, 14:29:07 PM
Custom field (it is a plugin). It can be displayed on both product detail and order view; but I display it only on the order view.
Title: Re: display order custom fields anywhere
Post by: PRO on November 17, 2016, 14:47:37 PM
why not just select if from DB>?
Title: Re: display order custom fields anywhere
Post by: kiwee on November 17, 2016, 15:17:16 PM
Quote from: PRO on November 17, 2016, 14:47:37 PM
why not just select if from DB>?

Why not, but how to do that ?
Title: Re: display order custom fields anywhere
Post by: GJC Web Design on November 18, 2016, 02:29:55 AM
Pro means write a standard joomla db query to select and display in your order templates etc
Title: Re: display order custom fields anywhere
Post by: Studio 42 on November 20, 2016, 22:59:04 PM
Any customfield in cart should be displayed in order too. SO perhaps your code is not complete.
Check textinput in /plugins/vmcustom how it work.
Title: Re: display order custom fields anywhere
Post by: jankoo on October 14, 2021, 14:57:32 PM
hi. whats the name of the plugin to have custom fields in order?
thank you