Hi everybody
I have made some development using user_class and user_pages to override and extend the VM 1 core files from VM themes.
I don't see these possibilities in VM2. Where can I find information about this? I understood that the VM themes are gone and are replaced as an override in joomla template>html>com_virtuemart but how to use my user_pages and user_class from there? Is it just a copy and paste of these folders in html>com_virtuemart? (eg template>html>com_virtuemart>user_class / user_pages or something like that?)
Thanks a lot for your answers
Fred aka Shemzone
Hi,
VM2 has been rewritten, and does not have anymore the VM1 classes and user_class.
To modify or add new functionalities, you can develop plugins. (http://dev.virtuemart.net/projects/virtuemart/wiki/Plugin_system#Extension-Plugins)
QuoteIs it just a copy and paste of these folders in html>com_virtuemart? (eg template>html>com_virtuemart>user_class / user_pages or something like that?)
it is not just a copy and paste.
But may be you can adapt your code with the template overwrite.
Thank you for your answer Valérie. I'll check this. I think that to rewrite my addon for VM will be an hard work. Anyway I must do it...
Currently, the developer manual for VM2 is very thin...
Regards
Shemzone
Hi,
Tell me what you wrote for the classes. I might be able to tell you how to solve the problem another way.
Hi again
I'm going to try to update my addon to VM2, once I'm in front of the wall, I'll ask. :)
Fred
Hi shemzone2,
Great,
May be you don't event need to do something? :)
Apart the template stuff (convert VM theme to J! template), I need to know how to extend the classes, the former shop_browse_queries.php (if it's gone), how to call my former $VM_LANG->load('myownaddon'); how to extend the former ps_product.php, and so on.
That why I used heavily the user_class and user_pages features.
I guess I have to extend my own classes by moving them to the controllers folder and to call them with
class VirtuemartControllerMyOwnAddon extends VmController {
...
}
Here, for example, what can I do to extend the save product function (I added extra fields which are filled while saving the product.
Must I use a new function to save my own fields in db like
function save(){
/* Load the data */
$data = JRequest::get('post');
/* add myownaddon_stuff as html code */
$data['myownaddon_stuff'] = JRequest::getVar('myownaddon_stuff', '', 'post', 'string', JREQUEST_ALLOWHTML );
parent::save($data);
}
or is there a way to extend the controllers/product.php without lose it at each new upgrade of VM?
I didn't dive yet in the VM code and maybe I'll find the solution someday.
Anyway, your help and advice are very welcome.
Fred
Hi
May be the Custom fields can help you to add some extra fields. Did you check that?
Hi
About the extra fields: no, not yet.
I'll check this.
The goal is to get what I've done with VM1 for www.bookshop-virtuemart.net (http://www.bookshop-virtuemart.net) with VM2
Fred
shemzone, what did you add. Cannot tell from your site.
Hi
I added a lot...
See some examples here:
http://www.bookshop-virtuemart.net/Terre-de-Brume/Collection-Granit-noir/ISBN-2-84362-043-0-Belfast-blues.html
http://www.bookshop-virtuemart.net/Terre-de-Brume/Beaux-livres/ISBN-2-84362-171-2-Chiens-de-Vie.html
http://www.bookshop-virtuemart.net/Les-auteurs/Yvon-Le-Men.html
http://www.bookshop-virtuemart.net/Lister-tous-les-auteurs.html
or here http://zalozba-meander.si/avtorji/lee-child.html
There are new tables in db
Full writers management (not simply authors) -> New table
Full extended information for a product (a book actually) -> New table
New dedicated stringq loaded with $VM_LANG->load('bookshop'); in french, english, slovenian, italian
The custom fields are not enough for me.
You an have a look to the changelog here:
http://www.bookshop-virtuemart.net/Bookshop-virtuemart/bookshop-for-virtuemart-changelog.html (http://www.bookshop-virtuemart.net/Bookshop-virtuemart/bookshop-for-virtuemart-changelog.html)
and a couple of tutorials here:
http://www.bookshop-virtuemart.net/Tutorials/ (http://www.bookshop-virtuemart.net/Tutorials/)
and complete manual here:
http://www.bookshop-virtuemart.net/Telecharger-document/15-Bookshop-for-Virtuemart-Quick-start-guide-English.html (http://www.bookshop-virtuemart.net/Telecharger-document/15-Bookshop-for-Virtuemart-Quick-start-guide-English.html)
Actually, this is not a hack (or just a couple of VM files since the last version of Bookshop) and I used user_class and user_pages because this can be switched off if you don't want use bookshop anymore.
It has/had its own install package via the update tool of VM 1.
Fred
Interesting. there are good and bad news for you :-)
First thing, yes extend your objects with the VmController, VmModel and so on.
Second, when you change the database tables, adjust the corresponding file table for it.
Third, you can easily add extra views to vm with a joomla component or plugin.
Fourth, afaik parts of your work can be done with customfields and a product pattern (unpublished parent product), for exampel ISBN, EAN.
For the authors I would add an extra view and an extra menu item beyond manufacturers and use a template overwrite. Just some ideas to handle it
Hi shemzone2
I knew your web site from before. Good job you have done with VM1.
I have done a similar web site, but it was for music.
QuoteFull extended information for a product (a book actually) -> New table
As said Max, you can handle the fields like ISBN, book type (policier, ...) with custom field.
QuoteFull writers management (not simply authors) -> New table
I didn't see what was the difference between writers and authors. But I think , I will create a category for each author. In the custom field, you can now select a related category. May be this solve the cross reference between the authors and the book.
QuoteNew dedicated stringq loaded with $VM_LANG->load('bookshop'); in french, english, slovenian, italian
In Joomla 1.7 you can do that easily, with the language overwriting.
Thank you Alatak and Max/Milbo for your advices and ideas.
I'll investigate all of this. The ideal world would be to expect all I have done in VM1 into VM2.
To be more accurate, I think that authors, VM speaking, are like an author in Joomla, meaning that is just a name linked to an account in Joomla. "My" writer/author is more of that. This is an author with a biography, a picture, some extra information and so on that you can link to a product. I guess, the authir in VM is not enough for me. However, the idea of custom field could do the trick, but no sure.
I will keep you informed if you are interested.
Fred aka Shemzone
Hi Fred,
QuoteThis is an author with a biography, a picture, some extra information and so on that you can link to a product.
If the author is a category, you can have the biography, the picture, and the link ti the product.
QuoteI will keep you informed if you are interested.
Yes we are :)
Hi Fred
You may have a look at the Extension Plugins
http://dev.virtuemart.net/projects/virtuemart/wiki/Extension_Plugins
They provides some methods that to add features into the VM core
Hi Valérie
Brilliant! Thanks a lot.
I was looking for something like that but I missed this one.
Thanks again :)
Fred
Hi Fred,
Great :)
QuoteI will keep you informed if you are interested.
I am still interested and curious.
Thank you for your interest
Especially from guys/gals from the dev team :)
I'm working currently on another project. As soon as I finish it, I'll start to migrate Bookshop
By the way, do you plan a version of "réussir sa boutique en ligne avec VM2"?
I advice always your book for customers who want to have a simple approach of ecommerce with Joomla.and VM.
Fred
Hi Fred,
QuoteBy the way, do you plan a version of "réussir sa boutique en ligne avec VM2"?
VM2 needs to be released first...
But i have started, but I have a lot to write ... I hope the book will be available in the librairies in december.
QuoteI advice always your book for customers who want to have a simple approach of ecommerce with Joomla.and VM.
That is great. Thank you.