VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: psm on August 13, 2021, 19:36:38 PM

Title: How to create plugin for VM
Post by: psm on August 13, 2021, 19:36:38 PM
Hello, please do you have any good tutorials how to make plugin for VM? I would like just to modify VM checkout by adding jquery code but I cannot find no good articles. Thanks
Title: Re: How to create plugin for VM
Post by: psm on August 18, 2021, 06:48:49 AM
I just little bit specify my question. What is the best way how to add jquery code by joomla plugin?

Is this the best way? And how can I choose that these code should be applied just for chceckout page?

Thank you

<?php

// no direct access
defined('_JEXEC') or die;

class 
plgContentHelloworld extends JPlugin
{
    public function 
onAfterRender() {
        echo 
'<script>';
            echo 
'alert("Hello World!");';
        echo 
'</script>';
        }
}

?>
Title: Re: How to create plugin for VM
Post by: GJC Web Design on August 18, 2021, 08:58:59 AM
detect what page your on ..

e.g.

$jinput = JFactory::getApplication()->input;
$option = $jinput->get('option');
$view = $jinput->get('view');
$task = $jinput->get('task');
if ($option == 'com_virtuemart' && $view == 'cart') {
echo 'blah';

}


Title: Re: How to create plugin for VM
Post by: psm on August 19, 2021, 15:58:00 PM
Thank you, now I am trying to collect and connect all information from web, so I do not know nothing about it.

I just have some intermediate knowldge from jquery, php and html.

When I will know result I will post it here.