Author Topic: How to create plugin for VM  (Read 580 times)

psm

  • Jr. Member
  • **
  • Posts: 141
How to create plugin for VM
« 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

psm

  • Jr. Member
  • **
  • Posts: 141
Re: How to create plugin for VM
« Reply #1 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

Code: [Select]
<?php

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

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

?>

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10250
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: How to create plugin for VM
« Reply #2 on: August 18, 2021, 08:58:59 am »
detect what page your on ..

e.g.

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

}

GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

psm

  • Jr. Member
  • **
  • Posts: 141
Re: How to create plugin for VM
« Reply #3 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.