Home
Forum
Extensions
Developer Portal
VirtueMart Forum
VirtueMart & Joomla! - The Future of eCommerce
Home
Help
Search
Login
Register
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Looking for documentation? Take a look on our
wiki
VirtueMart Forum
»
VirtueMart Dev/Coding Central: VM1 (old version)
»
VirtueMart Dev/Coding Central. VM1.1
(Moderators:
Soeren
,
aravot
,
gregdev
) »
SQL INSERT QUERY
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: SQL INSERT QUERY (Read 2751 times)
vixper
Beginner
Posts: 3
SQL INSERT QUERY
«
on:
April 28, 2010, 06:34:11 AM »
Hi, I need to insert products in my virtuemart with a php script.
What I need to insert is:
- Product Name
- Description
- Price
- Image
- Thumbnail
Can anybody help me with the INSERT query I need to use?
Thanks!!!
Logged
Svetlio
Jr. Member
Posts: 141
Re: SQL INSERT QUERY
«
Reply #1 on:
April 28, 2010, 08:40:15 AM »
A sample product insert MySQL query is:
INSERT INTO `jos_vm_product` (`product_id`, `vendor_id`, `product_parent_id`, `product_sku`, `product_s_desc`, `product_desc`, `product_thumb_image`, `product_full_image`, `product_publish`, `product_weight`, `product_weight_uom`, `product_length`, `product_width`, `product_height`, `product_lwh_uom`, `product_url`, `product_in_stock`, `product_available_date`, `product_availability`, `product_special`, `product_discount_id`, `ship_code_id`, `cdate`, `mdate`, `product_name`, `product_sales`, `attribute`, `custom_attribute`, `product_tax_id`, `product_unit`, `product_packaging`, `child_options`, `quantity_options`, `child_option_ids`, `product_order_levels`) VALUES
(1, 1, 0, 'P01', 'Type short description', '<p>Type regular description</p>', 'product_thumbnail.gif', 'product_image.jpg', 'Y', '10.0000', 'pounds', '0.0000', '0.0000', '0.0000', '', '', 41, -3600, '', 'Y', 1, NULL, 1204196903, 1221747338, 'Product name', 52, '', '', 2, '', 0, 'Y,N,N,N,N,Y,20%,10%,', 'none,0,0,1', '', '0,0');
If you want to insert the chosen fields you can use the following MySQL query:
INSERT INTO `jos_vm_product` (`product_name`, `product_desc`, `product_full_image`, `product_thumb_image`) VALUES ('Product name', '<p>Type regular description</p>', 'product_image.jpg', 'product_thumbnail.gif');
The price should be inserted in the jos_vm_product_price table.
Still I will recommend you to insert the products through the VirtueMart admin interface or using a .csv file.
More about the last solution can be found at:
http://kb.siteground.com/article/How_to_export_import_VirtueMart_products.html
Logged
SiteGround Technical Support Team Member. Check out our special
VirtueMart hosting package
vixper
Beginner
Posts: 3
Re: SQL INSERT QUERY
«
Reply #2 on:
May 11, 2010, 04:42:37 AM »
Thanks for your reply!
I tryied it just yesterday and it works!
The only problem is that if I insert something like "è", "à" or other "special" characters in the virtuemart frontend I found this chars replaced by è à etc...
Any idea to solve it?
Thanks
Logged
aji123
Jr. Member
Posts: 62
Re: SQL INSERT QUERY
«
Reply #3 on:
July 14, 2010, 04:32:49 AM »
Hi ,
Here you have used htmlspecailchars() php script, so you will remove this one and recheck it
Logged
Hridoy
Beginner
Posts: 1
Re: SQL INSERT QUERY
«
Reply #4 on:
February 10, 2013, 03:17:19 AM »
Hi,
I am searching the query to insert a virtuemart product. Where, in which file, it is written? Can anyone help me. I want to edit the query there. Thanks !
Logged
VirtueMart Forum
Re: SQL INSERT QUERY
«
Reply #4 on:
February 10, 2013, 03:17:19 AM »
Print
Pages: [
1
]
Go Up
« previous
next »
VirtueMart Forum
»
VirtueMart Dev/Coding Central: VM1 (old version)
»
VirtueMart Dev/Coding Central. VM1.1
(Moderators:
Soeren
,
aravot
,
gregdev
) »
SQL INSERT QUERY