Home Blog Tags PHP
Tags >> PHP
Apr 24
2010

Zen Cart to VirtueMart csv export

Posted by: Marko Tomic

Tagged in: Zen Cart , VirtueMart , PHP

Following my post on Zen Cart friendly URLs, I would now like to give VirtueMart some love.

I've been looking for ways to export Categories and Products from Zen Cart and bulk insert them into VirtueMart.  Wishful thinking? That's what I thought after googling for a solution and couldn't find anything that's convincing and, of course, free.

This motivated me to download a free version of CSV Improved component for VirtueMart and have a look at the csv format required for importing products into VM.  After a bit of head scratching I've come up with a pretty simple Zen Cart export tool that's very primitive, but worked nicely for me. It can certainly save you days/months of manual data entry, depending on the number of products you have. Keep in mind that this tool will only export Categories and Products. If you need to export other stuff, you'll have to extend this code a little bit. More info in readme.txt.

Download a copy of ZenCartToVirtueMartCSV.zip .

Don't run this script in production environment until you have tested it thoroughly. Make sure you read the readme.txt for requirements and instructions. Use it at your own risk.


This little script can definitely be improved, but it is all I have time for.  Feel free to modify it and use it as a base for something more sophisticated.

Happy Exporting
Marko

Apr 19
2010

Zen Cart Friendly URLs

Posted by: Marko Tomic

Tagged in: Zen Cart , PHP , HOWTO , Apache

I've been exploring Zen Cart shopping cart for a long time and one thing that, I thought, needed improvement was the support for friendly URLs. Ultimate SEO URLs break my site and I needed another solution. I found this little beauty called Simple SEO URL and it works beautifully.  It's a little tricky to set up, but it's worth the effort.  Installation process will take you about 15-20 minutes.

I use Zen Cart 1.3.8a and SSU 3.8.3. If you have different version(s) the following steps may not work.

Download Simple SEO URL


Requirements
1. PHP 5
2. mod_rewrite enabled on your Apache web server

3. Zen Cart Module Manager installed


Installation
1. Unzip and upload your files to web server
2. Go to Admin==>Extras==>SSU Manager
3. Open path_to_store/.htaccess and add:

If your .htaccess file already has stuff in it, do not overwrite it.  Simply append the following

#### BOF SSU
Options +FollowSymLinks
RewriteEngine On
# Change "/zencart/ to the correct setting
# if your site is located at root folder, then you should have RewriteBase /
# Go to your include/configure.php, this value should be the same with the value of DIR_WS_CATALOG
RewriteBase /zencart/

# Deny access from .htaccess
RewriteRule ^.htaccess$ - [F]

RewriteCond %{SCRIPT_FILENAME} -f [OR]
RewriteCond %{SCRIPT_FILENAME} -d
RewriteRule .* - [L]

RewriteRule ^(.+) index.php/ [E=VAR1:,QSA,L]
#### EOF SSU

Makle sure your "RewriteBase" path is correct.


4. Set path_to_cache_folder/ssu and its subfolders permission to 0777
5. Now go to Admin==>Configuration==>Simple SEO URL to enable and configure your friendly URLs.

That's it.  You can also test your installation http://yoursite/ssu_check.php after which you can remove ssu_check.php from your server.

Marko

Nov 02
2009

MAMP vs Entropy PHP on OS X

Posted by: Marko Tomic

Tagged in: PHP , OS X , MySQL , Apache

Following my post on Snow Leopard Gotchas, I discovered another problem you might run into. SL comes with currently the latest version of PHP 5.3.0. However, not all PHP projects will play nice on v5.3.0. What you could do is:

1. build and configure an older version of PHP from source - e.g. 5.2.11
2. Install Entropy PHP (note: this will modify your SL Apache config files).
3. Or just be lazy and install MAMP (Macintosh, Apache, MySQL, PHP) in a few seconds.

I chose the last option for 5 reasons:
1. I'm lazy
2. Comes with PHP 4.4.9 & 5.2.10
3. It installs a complete package in one directory
4. It doesn't mess with my existing apache config files
5. it's easy to uninstall.

This is particularly useful for content editors who have phobia of terminal windows (I don't blame them). Hopefully some developers will find this useful too.

After you've downloaded and installed MAMP, you'll notice that the installer created /Applications/MAMP directory. Launch your MAMP Control Center, start your services and away you go.

By default, your Apache web server will run on port 8888. You can change this to port 80 in Preferences, but if you do that you will have to make sure that your OS X Web Sharing is stopped. You can stop it in System Preferences=>Sharing=>Web Sharing.

Normally your Apache virtual would be here:

/etc/apache2/users/*.conf or /etc/apache2/extra/httpd-vhosts.conf

MAMP keeps virtual hosts separately in:

/Applications/MAMP/Library/vhosts

If you ever want to uninstall MAMP, all you need to do is Trash /Applications/MAMP directory and you're done. It's simple and clean.

For more info see MAMP documentation.

Problems you may have with Entropy PHP

NOTE: always backup any .conf file you are going to modify or remove.

Entropy PHP will add a new config file in /etc/apache2/other and possibly modify your httpd.conf. If you're having problems running PHP, there could be various symptoms. The one I was seeing in apache error logs was this one:

child pid 7563 exit signal Segmentation fault (11)

I'm not sure what this means exactly, but it happens when your Entropy config file:

/etc/apache2/other/+entropy-php.conf

tries to load the problematic php module:

LoadModule php5_module /usr/local/php5/libphp5.so

To solve this, I would recommend removing all Entropy stuff and go back to your native PHP 5.3.0. You could try removing, or backing up +entropy-php.conf and uncomment the following line in your httpd.conf

LoadModule php5_module libexec/apache2/libphp5.so

Also check that this file exists:

/etc/apache2/other/php5.conf

and that it contains

<IfModule php5_module>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

DirectoryIndex index.html index.php
</IfModule>

 

Stalk Me

Facebook: marko.tomic Twitter: mtomic Twitter: SydneyScuba YouTube: migonyourtail Linked In: tomicmarko MySpace: markomedia Google Wave: marko2009 blip.fm: markotomic Flickr: markotomic FeedBurner: markomedia

Site Login

Tag Cloud

Browser Poll

What browser do you use?