VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: nordmograph on October 20, 2011, 15:03:37 PM

Title: Support for content plugins
Post by: nordmograph on October 20, 2011, 15:03:37 PM
Hello

I read the sticky post and understood that front end content plugin will not be supported in VM2.0 but probably in future updates
true? If so any clue on when?

I need an event to display a plugin on category pages and on product pages. Will this be possible?
If not I'll have to use a module instead but a plugin would be more suitable.

Thanks for letting me know
Title: Re: Support for content plugins
Post by: PRO on October 20, 2011, 17:44:34 PM
content plugins will work
Title: Re: Support for content plugins
Post by: alatak on October 21, 2011, 12:49:39 PM
Hi,

Content plugin work in the product description.
Please update to the J version.
Title: Re: Support for content plugins
Post by: nordmograph on October 24, 2011, 00:11:57 AM
Hi thanks a lot for your replies

Edit: oups sorry I just found it
My content plugin working in j1.7 content articles doesn't seem to work in products page
Anything specific I missed?

What about in category pages I also need a plugin to load and show on category pages. Any chances it could work?
Or would I have to turn it into a module?

thanks
Title: Re: Support for content plugins
Post by: Studio 42 on October 26, 2011, 22:44:23 PM
YOu must active content plugin in
admin virtuemart>> config

Enable content plugin
Title: Re: Support for content plugins
Post by: svm on October 26, 2011, 23:53:43 PM
i have the newest version of vm2 and i found the button, but not all content plugins will be shown to the user....
Have someone else a simliar bug?
Title: Re: Support for content plugins
Post by: itmostro on October 27, 2011, 15:36:30 PM
Quote from: Electrocity on October 26, 2011, 22:44:23 PM
YOu must active content plugin in
admin virtuemart>> config

Enable content plugin

I check the option "Enable Joomla Plugin" in VM configuration, but I can't see the product detail yet...
I have to do some other operation?

thanks!
Title: Re: Support for content plugins
Post by: PRO on October 27, 2011, 18:01:27 PM
Quote from: svm on October 26, 2011, 23:53:43 PM
i have the newest version of vm2 and i found the button, but not all content plugins will be shown to the user....
Have someone else a simliar bug?


what plugin is it? and what triggers it?
Title: Re: Support for content plugins
Post by: DaffRider on November 10, 2011, 13:40:30 PM
HI all

I use Joomla 1.7 and VM 2.0

I modify some fields in product table for create VOD store

i use this great tutorial -> http://www.abemedia.co.uk/blog/tutorials/create-pay-on-demand-content-in-joomla-using-virtuemart-chameleon.html

My question is simple

OK product_desc ok for Content plugin but how and news elements for include this on rules:


if ( VmConfig::get('enable_content_plugin',0)) {
// add content plugin //
$dispatcher =& JDispatcher::getInstance();
JPluginHelper::importPlugin('content');
$product->text = $product->product_desc;
$params = "";

$results = $dispatcher->trigger('onPrepareContent',
array (& $product, & $params, 0));
$product->product_desc = $product->text;



I have 2 fields include in this code:

product_premium_content and product_premium_teaser

How modify code for include this fields of table ? like product_desc

I use allvideo plugins and only display in the product_desc, because he's only include in the rule :(

Thx lot of and sorry for my bad english (im french ^^)

David


Title: Re: Support for content plugins
Post by: mygbn on December 18, 2011, 21:16:12 PM
Im trying to get Core Design Magic Tabs plugin to work with V2 but the plugin is not showing in the product i have activated Both plugins needed and also ticked the box in Configuration/shop is there something that i have missed or is there any coding that needs to go into the default.php please help if i have missed anything.

Thank You
Title: Re: Support for content plugins
Post by: Studio 42 on December 26, 2011, 21:35:08 PM
Hello daffrider,
Je suis aussi français.
pour utilisé un autre champs il suffit de lui indiquer le bon nom mais bien sur sans support HTML cela va être difficile d'ajouter un plugin dans un autre champs(a part dans category_desc)

HI all,
the code from daffrider can be used all table fields supporting html as category_description for eg.
Title: Re: Support for content plugins
Post by: Virtual on August 15, 2012, 16:36:01 PM
Quote from: DaffRider on November 10, 2011, 13:40:30 PM
How modify code for include this fields of table ? like product_desc

I use allvideo plugins and only display in the product_desc, because he's only include in the rule :(

I have same problem. I added $this->editor->display to product_s_desc in /administrator/components/com_virtuemart/views/product/tmpl/product_edit_description.php and now I want to add this field to rule in /components/com_virtuemart/views/productdetails/view.html.php but I don't know how?

@Milbo please help! :( vm2.0.6
Title: Re: Support for content plugins
Post by: Virtual on August 16, 2012, 08:01:11 AM
Resolved:
<?php echo $this->product->product_s_desc JHTML::_('content.prepare'$this->product->product_s_desc); ?>
Title: Re: Support for content plugins
Post by: mhuebler on September 28, 2015, 15:44:03 PM
anybody know how to use the conent plugin wthin vm product custom fields ?

EDIT

found finally a solution by customizing the product details template.

<?php 
$db 
JFactory::getDBO();
$query $db->getQuery(true);
$query->select('customfield_value');
$query->from('#__virtuemart_product_customfields');
$query->where('virtuemart_product_id="' . (int) $db->escape($this->product->virtuemart_product_id) . '"');
$query->where('virtuemart_custom_id="XXX"');
$db->setQuery($query);
$customfield_custom_display $db->loadResult();
if (
$customfield_custom_display != '')
echo 
$customfield_custom_display JHTML::_('content.prepare'$customfield_custom_display);
?>
Title: Re: Support for content plugins
Post by: PRO on September 29, 2015, 10:53:14 AM
Quote from: mhuebler on September 28, 2015, 15:44:03 PM
anybody know how to use the conent plugin wthin vm product custom fields ?

EDIT

found finally a solution by customizing the product details template.

<?php 
$db 
JFactory::getDBO();
$query $db->getQuery(true);
$query->select('customfield_value');
$query->from('#__virtuemart_product_customfields');
$query->where('virtuemart_product_id="' . (int) $db->escape($this->product->virtuemart_product_id) . '"');
$query->where('virtuemart_custom_id="XXX"');
$db->setQuery($query);
$customfield_custom_display $db->loadResult();
if (
$customfield_custom_display != '')
echo 
$customfield_custom_display JHTML::_('content.prepare'$customfield_custom_display);
?>



lol, why are you doing all this? these are already there

$field->virtuemart_custom_id

$field->customfield_value

No need to query the database for nothing.

Title: Re: Support for content plugins
Post by: mhuebler on September 29, 2015, 11:17:52 AM
Quotelol, why are you doing all this? these are already there

$field->virtuemart_custom_id

$field->customfield_value

No need to query the database for nothing.

thank you for sharing :-)
Title: Re: Support for content plugins
Post by: Milbo on September 30, 2015, 23:14:22 PM
soo?

<?php 
if ($field->customfield_value != '')
echo 
$customfield_custom_display JHTML::_('content.prepare'$field->customfield_value);
?>


Btw, there is a small problem in vm3.0.10 with the content plugins with the ajax reload. Is fixed, version will follow
Title: Re: Support for content plugins
Post by: istvixs on August 08, 2016, 21:49:01 PM
Hi!
Please help!
This code which file and where to insert?
Title: Re: Support for content plugins
Post by: GJC Web Design on August 08, 2016, 21:53:25 PM
where ever u want the custom field to appear.. normally your product details template
Title: Re: Support for content plugins
Post by: Studio 42 on August 08, 2016, 22:59:47 PM
Quote from: istvixs on August 08, 2016, 21:49:01 PM
Hi!
Please help!
This code which file and where to insert?
This depend what field you want to trigger the content plugin.
Title: Re: Support for content plugins
Post by: istvixs on August 09, 2016, 07:46:10 AM
Hi!
Thank You quick answer. I want to use two places:
1, vm short description
2, Custom Fields string, editor, textarea.
I use t3_bs3_blank template.
Title: Re: Support for content plugins
Post by: Studio 42 on August 09, 2016, 10:45:02 AM
For the "core" customfield, you need to overide YOURSITE\components\com_virtuemart\sublayouts\customfield.php and add directly your code inside function renderCustomfieldsFE to add content plugin for selected types(editor,textarea...).
Another solution is overide YOURSITE\components\com_virtuemart\sublayouts\customfields.php and check the customfield type and only for some positions(it's better to not trigger plugin when not needed).
Title: Re: Support for content plugins
Post by: istvixs on August 12, 2016, 08:18:37 AM
Thanks for the help!

(Back to the forum I read the product_s_desc works well Thanks!)

I want you to custom fields independently of the position (normal, on top, addToCart, filter) any type or all type (string, text area, editor) would work with Joomla content plugins. Please step by step.
Title: Re: Support for content plugins
Post by: Studio 42 on August 12, 2016, 10:58:15 AM
See https://docs.joomla.org/Triggering_content_plugins_in_your_extension for the generic way to do it. All the other info was already explained in the messages before.
Title: Re: Support for content plugins
Post by: istvixs on September 08, 2016, 18:27:23 PM
Thanks for the help!

I am doing so:


/* text area or editor No vmText, only displayed in BE */
case 'X':
case 'Y':
$customfield->display = JHTML::_('content.prepare', $customfield->customfield_value);

break;


I only have one problem. If you choose child products with dropdown list, content plugin does not work. If html page reload, it works. (ajax reload problem?)
Title: Re: Support for content plugins
Post by: istvixs on September 09, 2016, 10:24:35 AM
If disable virtuemart settings Use ajax for product content, everything is alright. Ajax can be solved?
Title: Re: Support for content plugins
Post by: Milbo on September 12, 2016, 19:33:25 PM
Which version do you use? it should be solved since vm3.0.10