VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: myplace2100 on February 27, 2013, 18:05:17 PM

Title: Add product using api
Post by: myplace2100 on February 27, 2013, 18:05:17 PM
I don't want to add product in virtue mart by inserting directly in database. what is the best way to add  custom product by coding in my module using api ?
i can list products by accessing vm model like -

$productModel = VmModel::getModel('Product');
$products = $productModel->getProductListing('random', '10', '1', true, false,'1','1');
but don't know which functions does product adding properly.

Please help.
Title: Re: Add product using api
Post by: Dudebaker on March 28, 2013, 10:55:14 AM
I would need the same info... and for Categories too.
Or do we have to wait till virtuemart integrates the front-end adding function?
Title: Re: Add product using api
Post by: PolishedGeek on March 29, 2013, 14:34:09 PM
We've done a lot of custom integration with VM2 and usually have found that it's simplest to write our own API the way we want than to try to leverage the VM2 calls.

Another option would be to get a copy of a VM2 import extension like CSV Improved (http://www.csvimproved.com/) and examine the code they are using to import products and categories. That should jump start you on your way a lot faster than trying to figure it out from scratch.
Title: Re: Add product using api
Post by: cerealkiller on July 16, 2013, 17:35:16 PM
i have exactly the same issue, and csvi is not a great help, cause its classes are really messy and complicated, related to his primary function of csv import... myplace2000, did you find a way to do this ?
Title: Re: Add product using api
Post by: Maxim Pishnyak on July 16, 2013, 22:10:11 PM
Aren't xml and soap protocols not helpful for such task?
Title: Re: Add product using api
Post by: AH on July 16, 2013, 22:22:28 PM
Maxim

point me to the documentation please
Title: Re: Add product using api
Post by: Maxim Pishnyak on July 17, 2013, 14:15:50 PM
I hope this could be helpful.

3rd party soap
http://www.virtuemart-datamanager.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=83&category_id=21&option=com_virtuemart&Itemid=29
http://www.virtuemart-datamanager.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=94&category_id=18&option=com_virtuemart&Itemid=29&vmcchk=1&Itemid=29
doc
http://www.virtuemart-datamanager.com/soap/VM2_SOAP_DOC.html
http://www.virtuemart-datamanager.com/index.php?option=com_content&view=category&id=27:new-to-joomla&layout=blog&Itemid=44&layout=default
3rd party xml
Quote from: Maxim Pishnyak on July 08, 2013, 23:28:20 PM
Hi,

You may view
http://www.easysoftware.eu/virtuemart-xml-product-import-easy-parser (be carefull, probably this web site hacked)
or
http://www.easyjoomla.org/virtuemart-xml-product-import-easy-parser

Could I ask you to post in this thread your opinion about this solutions, cos
this xml importers aren't reviewed on current forum in 3d party section and
even here http://extensions.joomla.org/extensions/extension-specific/virtuemart-extensions/virtuemart-import/22722

Regards.