VirtueMart Forum

VirtueMart 2 + 3 => Templating & Layouts => Topic started by: EvanGR on January 07, 2019, 14:41:57 pm

Title: VM Admin Products Page: Show custom fields used in each product
Post by: EvanGR on January 07, 2019, 14:41:57 pm
In the VM Products page (back-end), we want to tweak the admin template to show the custom fields used for each product.

Can you give me a starting point on how to access this data?

Thank you!

[VM3.2.15]
Title: Re: VM Admin Products Page: Show custom fields used in each product
Post by: GJC Web Design on January 07, 2019, 14:47:59 pm
administrator\components\com_virtuemart\views\product\tmpl\default.php
Title: Re: VM Admin Products Page: Show custom fields used in each product
Post by: EvanGR on January 07, 2019, 15:21:03 pm
Thank you.

I have var_dumped the $product object, but I can't seem to find info about the custom fields in use... Have I not looked carefully, or do I find them in a different way?
Title: Re: VM Admin Products Page: Show custom fields used in each product
Post by: GJC Web Design on January 07, 2019, 19:41:47 pm
I don't know -- I assume they are not there for performance reasons

you can get the customs I guess by importing the custom model etc etc -- see how its done on the invoice/email frontend pricelists etc
Title: Re: VM Admin Products Page: Show custom fields used in each product
Post by: Studio 42 on January 08, 2019, 01:13:31 am
EvanGR, what is the final need?
All secondary product tables are joined using virtuemart_product_id
Check the #__virtuemart_product_customfields table with phpmyAdmin or a similar tool, if you need to code something yourself.
If you need a specific view, it is better to write a vmextend plugin that modifies the Virtuemart core code, i use this each time a need to include custom features in the virtuemart back-end
Title: Re: VM Admin Products Page: Show custom fields used in each product
Post by: EvanGR on January 08, 2019, 08:50:16 am
Hello and thanks for the replies.

My need is to be able to quickly see which products have custom fields in them, in the vm Products view (admin).

example: Currently, I am adding Manufacturer/Model custom fields to hundreds of products. I have missed some products, and it's very time consuming to find out which.

Thanks

Title: Re: VM Admin Products Page: Show custom fields used in each product
Post by: Studio 42 on January 08, 2019, 10:37:07 am
I think that the only right solution is to write a new vmextended plugin to display your customfeilds.
But for a customer i have write a vmextended product tagger to search for keywords in the short desc(or other field of your choice) and  add the corresponding tag as custom fields.
Perhaps, it's the solution you need ?