News:

Looking for documentation? Take a look on our wiki

Main Menu

sql insert statement for inserting a new product

Started by LAP0109, January 26, 2015, 12:12:20 PM

Previous topic - Next topic

LAP0109

Hey

For my shop i need to insert products via the tables on the sql server. So i need to insert them via a sql statement.

Can anybody show me the correct sql insert statment? I want to insert the product id, product name, product description, price, category, image and amount.

I am using virtuemart version 2.

Kind regards

GJC Web Design

it is a multi join statement as you need at a min. 5 + tables

products, p prices, p cats, p lang, p medias, p product_medias, p manufactuers -- extend if shopper groups, taxes, customs

so not easy -- if I have to do it I use a script to do it table by table - or dig in the product model file to see how it's done
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AH

Yes it is tricky!!

You may want to look at using a CSV import, where most of the hard work of importing has been done

CSVI

http://www.csvimproved.com/en/
Regards
A

Joomla 3.10.11
php 8.0

LAP0109

No csvi won't help me, because i don't want to add products via the backend, i want to do this via an application, so i really need this sql inserts please?

Or has anyone of you an other plan how i can make this?

Thank you so far

GJC Web Design

As we said - it is complex - I have built scripts as commercial jobs for updating VM's tables directly from xml, csv etc etc

the script can easily run to 700+ lines of code

if you can't code then.....  Hutson's suggestion applies - download csvi and see how he does it -- the queries are the same

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AH

Or you can google

Virtuemart Product management and see what appears - top link might be of some use!!
Regards
A

Joomla 3.10.11
php 8.0