Author Topic: Add product using api  (Read 4308 times)

myplace2100

  • Jr. Member
  • **
  • Posts: 50
    • Tech and extensions
  • Skype Name: mridulcs
Add product using api
« 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.
joomla & wordpress extension developer

Dudebaker

  • Beginner
  • *
  • Posts: 5
Re: Add product using api
« Reply #1 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?

PolishedGeek

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 263
  • Joomla! Innovation Refined.
    • Polished Geek, LLC - Joomla! extensions, web development & custom integrations
Re: Add product using api
« Reply #2 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.
~ Deb Cinkus, CEO
Polished Geek, LLC   |    www.PolishedGeek.com

Creators of JoomLister - eBay Lister for Joomla!

cerealkiller

  • Beginner
  • *
  • Posts: 7
Re: Add product using api
« Reply #3 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 ?

Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
Re: Add product using api
« Reply #4 on: July 16, 2013, 22:10:11 pm »
Aren't xml and soap protocols not helpful for such task?

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2912
  • VirtueMart Version: 3.4
Re: Add product using api
« Reply #5 on: July 16, 2013, 22:22:28 pm »
Maxim

point me to the documentation please
regards
A

Joomla 3.9.1
php 7.1