News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Correct way to extend VM2? Extension Plugins or jos_virtuemart_modules or ...?

Started by Gruz, October 05, 2011, 22:57:31 PM

Previous topic - Next topic

Gruz

Hi.
I want to port my VM Import  extension from 1.1.x to 2.0.
Now I use J1.7+VM2 G

It was ran "from inside" VM to use it's functions to add products, types and so on. It was preparing data as if they were filled by hands and submitted from VM backend and passed them to VM core functions.
Here it is at a Russian forum: http://joomlaforum.ru/index.php/topic,150010.msg813807.html#msg813807


How it worked in 1.1.x
1. Installation
I used a Joomla 1.5 component installer possibilities to copy 3 files into the VM folder:
administrator/components/com_virtuemart/html/admin.simple_csv_install.php
administrator/components/com_virtuemart/html/product.simple_csv.php (now it's can be called a view)
administrator/components/com_virtuemart/classes/ps_simple_csv.php (now it's can be called a model)

Then I ran a link (http://sandbox.com.us/administrator/index.php?option=com_virtuemart&page=admin.simple_csv_install) to execute the file:

The file used the following class to add my function to jos_vm_function table
require_once(CLASSPATH.'ps_function.php');
$ps_function = new ps_function;
//and so on...




2. Workflow
Then I could ran a link http://sandbox.com.us/administrator/index.php?option=com_virtuemart&page=product.simple_csv to have my "view" file displayed:

After submitting the form at the above screenshot my class administrator/components/com_virtuemart/classes/ps_simple_csv.php was used to do the job.




So now I need to rewrite it for VM2.0 and I'm stack with new VM approaches.
So I need a direction to dig. What is the analogue of function in 1.1.x now in VM 2.0?
It seems to be jos_virtuemart_modules , correct? Is there any procedure to install custom modules then?
Or maybe I'm wrong:
I read at developer wiki about Extension Plugins:
http://dev.virtuemart.net/projects/virtuemart/wiki/Extension_Plugins
QuoteThis event is fired, when the called view was not found in the backend maincontroller. It allows to add new views to virtuemart

Can I read somewhere about it? Give me some guides, please!
Maybe a module/plugin to use as an example?

P.S. API documentation link here is broken: http://dev.virtuemart.net/projects/virtuemart/wiki/API_documentation
http://vm1.directrouter.com/~virtuem/api/
Your installable language for VM2: http://gruz.org.ua/virtuemart-language-files.html

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/