VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Development & Testing => Topic started by: dlesin on January 14, 2017, 18:08:24 PM

Title: Extending VM product content
Post by: dlesin on January 14, 2017, 18:08:24 PM
Hello!
Sorry if I'm wrong writing to this area of forum.
I'm trying to extend VM tool for my own purposes. I need to update product page on fly and print it together with categories and manufactures modules. I was trying to use a typical Joomla approach developing custom plugin called based on onContentPrepare event.
And I can get article content (to modify it on fly) everywhere in Joomla except for VirtueMart part which is called in a separate Joomla menu. Apparently, VM builds its own article content for Joomla not permitting do the same for any other plugins!
Can you please give me a brief recommend which way could be most effective to modify product content on fly without direct coding within VM? Is it possible, in general?
Thank you very much in advance!
Title: Re: Extending VM product content
Post by: PRO on January 14, 2017, 22:52:13 PM
Quote from: dlesin on January 14, 2017, 18:08:24 PM
Hello!
Sorry if I'm wrong writing to this area of forum.
I'm trying to extend VM tool for my own purposes. I need to update product page on fly and print it together with categories and manufactures modules. I was trying to use a typical Joomla approach developing custom plugin called based on onContentPrepare event.
And I can get article content (to modify it on fly) everywhere in Joomla except for VirtueMart part which is called in a separate Joomla menu. Apparently, VM builds its own article content for Joomla not permitting do the same for any other plugins!
Can you please give me a brief recommend which way could be most effective to modify product content on fly without direct coding within VM? Is it possible, in general?
Thank you very much in advance!

When you say "print" do you mean to print it on a printer? Or ECHO ?

Why not make a vm customfield plugin.

You can sql "select" the joomla content via the plugin. Backend product, your form field could just be a select list of the joomla article.

Title: Re: Extending VM product content
Post by: Studio 42 on January 14, 2017, 23:08:19 PM
You can enable content plugin in VM, this should solve your problem if your plugin is a system or content plugin.
Perhaps you have to add some codes in your plugin if it not work
Title: Re: Extending VM product content
Post by: dlesin on January 15, 2017, 08:49:17 AM
Quote from: PRO on January 14, 2017, 22:52:13 PM
When you say "print" do you mean to print it on a printer? Or ECHO ?

Why not make a vm customfield plugin.

You can sql "select" the joomla content via the plugin. Backend product, your form field could just be a select list of the joomla article.

Hi PRO,
Sorry, I was not clearly writing earlier. If more exactly, I created custom fields for products in VirtueMart such as next: "annotation", "auditory", "precondictions". They are now displayed in Web page together with description of a product. But I need to add some specific info to all these fields including the description one on fly. In this way, I already have custom fields but there are template products which contain info in fields which should be added to the first product.
Title: Re: Extending VM product content
Post by: dlesin on January 15, 2017, 09:18:38 AM
Quote from: Studio 42 on January 14, 2017, 23:08:19 PM
You can enable content plugin in VM, this should solve your problem if your plugin is a system or content plugin.
Perhaps you have to add some codes in your plugin if it not work

Hi Studio 42,
It works! Thank you!