Author Topic: VirtueMart 2 Bulk Products Importer (CSV)  (Read 22517 times)

OldLodgeSkins

  • Beginner
  • *
  • Posts: 31
VirtueMart 2 Bulk Products Importer (CSV)
« on: November 23, 2011, 14:45:35 pm »
Hi all,

I've just finished my first extension, which is now pending approval both here and on the JED.
I really like the new VM2 but I was missing an import feature, so here it is. And please, don't forget this is my first Joomla extension ever ;)
This will be my way of sending something back after using all that great and free stuff... ;)

Licence: GPLv2
Installs on: Joomla! 1.7 with VM2


Please note that as of v0.8 I still have two problems with the installation file that you need to be aware of (the component installs just fine, though):
  • The main menu item won't work (it doesn't redirect to the right view), you'll find a sub-menu in it, use that.
  • The French language files are present in the archive but don't seem to get installed. I still have to figure out why. The English translation works just fine.

Apart from this the component seems to work just fine for me. It will import:

  • Product SKU
  • Product name
  • Product price
  • Product currency
  • Product short desc
  • Product desc
  • Product thumbnail
  • Product image
  • Product category ID
  • Availability date & creation date are generated from the current date

It also checks the existing SKUs before importing and discards any product for which the SKU is already present.

Your CSV file should be formatted exactly like this (with the same column headers and in the same order, this is important):
product_sku~product_title~product_price~product_currency~product_short_desc~product_desc~product_thumbnail~product_image~category_id
P020301~Boussole extra-plate~2.50000~EUR~Boussole plate avec dragonne~Boussole plate avec dragonne, en noir~Boussole_extra_p_150x150.jpg~Boussole_extra_p.jpg~3
P030302~Set outillage~33.21000~EUR~Lampe torche Wave, 1 LED~Lampe torche Wave, 1 LED, plus outil à 10 fonctions en aluminium~Set_outillage_150x150.jpg~Set_outillage.jpg~2

You will also need to upload your pictures manually, this component will only fill the database with the picture's names.
Note that this needs to be tested, I've concentrated on developing the main functions but have only tested it quickly. In any case this isn't intended for a production site yet.


Seb.

lemtrac

  • Beginner
  • *
  • Posts: 11
Re: VirtueMart 2 Bulk Products Importer (CSV)
« Reply #1 on: November 28, 2011, 11:52:36 am »
Greetings Please help

I wanted to demonstrate the new VM for a potential client and tried downloading your component which is only a index.php file - should this not be an installation component ?

OldLodgeSkins

  • Beginner
  • *
  • Posts: 31
Re: VirtueMart 2 Bulk Products Importer (CSV)
« Reply #2 on: November 28, 2011, 12:01:11 pm »
Hi,

I believe this has more to do with the forum and your browser... The attached file is an archive.

Seb.

Edit: it seems I get an index.php file while downloading it too, but this is actually my archive. Just rename it to com_vmbpi-0.8.tar.gz (then try and open it in your favorite archive manager if you wish you'll see it's actually a Joomla component).

lemtrac

  • Beginner
  • *
  • Posts: 11
Re: VirtueMart 2 Bulk Products Importer (CSV)
« Reply #3 on: November 28, 2011, 13:56:52 pm »
No I get an error on my file please may I email you the csv as it

The columns of your file do not match teh required format

OldLodgeSkins

  • Beginner
  • *
  • Posts: 31
Re: VirtueMart 2 Bulk Products Importer (CSV)
« Reply #4 on: November 28, 2011, 14:27:15 pm »
If you like, you could also post the first few lines here. Make sure you respect the format I quoted above and that you have Unix line breaks (not sure if windows line breaks would work or not).

Edit: most likely, you've made either one of these mistakes:
  • You don't have the same number of columns.
  • Your columns are not in the same order.
  • You don't have the same column titles.
  • You don't have the same separator.

OldLodgeSkins

  • Beginner
  • *
  • Posts: 31
Re: VirtueMart 2 Bulk Products Importer (CSV)
« Reply #5 on: December 14, 2011, 17:28:45 pm »
Here's version 0.8.1 that corrects a couple of bugs thanks to Michthom:

  • The categories IDs should now be inserted correctly.
  • The pictures paths and names should also be valid now.

nacho.brito

  • Beginner
  • *
  • Posts: 3
Re: VirtueMart 2 Bulk Products Importer (CSV)
« Reply #6 on: December 18, 2011, 15:24:03 pm »
Hi,

thanks for this component, it has been very useful for us, but we had to make a small change to support the new schema, after the multilingual shop feature. Please find attached the modified Model in case you want to integrate in the importer.

OldLodgeSkins

  • Beginner
  • *
  • Posts: 31
Re: VirtueMart 2 Bulk Products Importer (CSV)
« Reply #7 on: December 18, 2011, 16:22:42 pm »
Thanks, I'll take a look at it as soon as I find the time :)

flaterik

  • Jr. Member
  • **
  • Posts: 100
Re: VirtueMart 2 Bulk Products Importer (CSV)
« Reply #8 on: December 30, 2011, 02:01:07 am »
Hi, it doesn't work for me.
The system say that all is correct and correctly imported but when i go to the product, no product !

dominiosclave

  • Beginner
  • *
  • Posts: 12
Re: VirtueMart 2 Bulk Products Importer (CSV)
« Reply #9 on: December 30, 2011, 10:00:13 am »
¿updated to final version?

OldLodgeSkins

  • Beginner
  • *
  • Posts: 31
Re: VirtueMart 2 Bulk Products Importer (CSV)
« Reply #10 on: December 30, 2011, 10:31:33 am »
Hi guys,

Sorry I haven't had time to work on it recently.
I have recently discovered that the method I use to read the CSV file may not work on all hosts, something to do with the configuration of PHP I believe, I've discovered this in an other script of mine I use on an older VM1, so I'll have to replace it that's the only explanation I see for your problem flaterik. I already know how to replace it, I just didn't get the time.

Seb.

chadgarber

  • Jr. Member
  • **
  • Posts: 62
    • Garber Consulting, Inc.
Re: VirtueMart 2 Bulk Products Importer (CSV)
« Reply #11 on: December 30, 2011, 18:07:24 pm »
This tool is exactly what I need but I can't get it to work. I formatted the csv the way you say but it still give me the "The columns of your file do not match teh required format" error.  Here is the some of the text (what am I doing wrong)?

"product_sku","product_title","product_price","product_currency","product_short_desc","product_desc","product_thumb_image","product_image"," category_id",," "," "," "
"Test Product 1","Test Product 1",1,"usd",,,,,,,,,
"Test Product 1","Test Product 1",1,"usd",,,,,,,,,
"Faux Turquoise Necklace with Silver Focal Bead","Faux Turquoise Necklace with Silver Focal Bead",30,"usd","This "" necklace features heavy faux turquoise round beads that are accented with a variety of silver, black, clear and gray beads of several shapes. A large silver cutout sphere acts as a focal point for the piece.","While I have been to several Indian reservations, this faux turquoise necklace is anything but authentic. It's a bit over the top because of the size of the beads and the weight of the piece.  The "" necklace is a total of a wide variety of shape and colored beads that highlight the turquoise-colored round beads and the silver focal point sphere.  A silver toggle clasp finishes the piece.",,,,,,,
"Double-Stranded Black, Silver, and White Necklace with Shell Focals","Double-Stranded Black, Silver, and White Necklace with Shell Focals",25,"usd","The inner and outer strands ("" and "") coordinate beautiful while they are not identical.  The outer strand contains 5 black shell beads that act as mini-drops.","The strands of this double-stranded necklace are composed of silver metallic balls, clear and silver faceted crystal beads, faceted black agate tube beads and chips, and white fresh water pearls.  In addition to these, the outer strand is highlighted with 5 black shell beads that act as mini-pendants.",,,,,,,
Chad Garber
Web Developer/Computer Support
770.639.4847
Garber Consulting, Inc.
http://garberconsulting.net

chadgarber

  • Jr. Member
  • **
  • Posts: 62
    • Garber Consulting, Inc.
Re: VirtueMart 2 Bulk Products Importer (CSV)
« Reply #12 on: December 30, 2011, 18:08:38 pm »
What should the separator be?
Chad Garber
Web Developer/Computer Support
770.639.4847
Garber Consulting, Inc.
http://garberconsulting.net

chadgarber

  • Jr. Member
  • **
  • Posts: 62
    • Garber Consulting, Inc.
Re: VirtueMart 2 Bulk Products Importer (CSV)
« Reply #13 on: December 30, 2011, 18:09:59 pm »
~?
Chad Garber
Web Developer/Computer Support
770.639.4847
Garber Consulting, Inc.
http://garberconsulting.net

OldLodgeSkins

  • Beginner
  • *
  • Posts: 31
Re: VirtueMart 2 Bulk Products Importer (CSV)
« Reply #14 on: December 30, 2011, 18:11:48 pm »
Yep.

VirtueMart Forum

Re: VirtueMart 2 Bulk Products Importer (CSV)
« Reply #14 on: December 30, 2011, 18:11:48 pm »