Today at the office I was asked to help migrating the webshop from Mamut to Joomla Virtuemart.
I installed the new webshop, and used the plugin CSVImport to import all data about the products.
As allways Mamut was a pain in the a**, you can export all products BUT:
- Without all descriptions you perfectly made of the last year
- Without all pictures chosen
- Without a normal layout in the Categories (messed up with some $$%# charcs)
I’m still working on the pictures and descriptions, found the correct database file but they work with MEMO fields. For some reason the format is not default and cannot be readout easily (keep in touch).
use strict;
# the input file (place in same dir as the script)
my $file = “in.csv”;
# output file (will be created in the script dir)
my $outfile = “catout.csv”;
# check for input file
open(IN, “<$file”) or die “Could not open $file\n”;
#check for permission to write output
open(OUT, “>$outfile”) or die “Could not open $outfile\n”;
# while there are input lines
while (<IN>)
{
chomp;
# split the input line at the comma char (you can change this)
my @line = split(“,”);
# Replace the Mamut category mess with the \ char
$line[3] =~ s/\%\%/\//g;
# print the parsed line to the output file.
# Note: You have to use \ to escape the ” char \”\” means an empty entry.
print OUT “$line[3],\”\”,\”\”,\”\”,\”\”,\”managed\”,\”flypage.tpl\”,\”y\”,\”\”,\n”;
}
# close input file
close(IN);
# close output file
close(OUT);
Code for products:
#! /usr/bin/perl -w
use strict;
my $file = “in.csv”;
my $outfile = “out2.csv”;
open(IN, “<$file”) or die “Could not open $file\n”;
open(OUT, “>$outfile”) or die “Could not open $outfile\n”;
while (<IN>)
{
chomp;
my @line = split(“,”);
$line[3] =~ s/\%\%/\//g; # replace the category
print OUT “$line[0],\”\”, $line[3], $line[1],\”\”,\”\”,$line[11],\”\”,\”\”,\”\”,\”\”,\”EUR\”,\”\”,\”\”,\”\”,\”\”,\”Y\”,\”N\”,\”\”,\”\”\n”;
}
close(IN);
close(OUT);