Delete the Zen-Cart Store Demo files, images, and Data

October 11, 2012

How to get rid of zen-carts demo store – including version 1.5.0.
“How to clean up default install and remove example store related files.”
How to remove, or delete, the “Zen Cart demonstration categories and products”.
Help with installing Zen-cart, help removing Zen-cart’s demo store.
How to Delete all the Zen-Cart Sample Store files, images, and Data.

Install Zen-Cart and choose “NO” to the “Store Demo”:
(Would you like to install the Zen Cart demonstration categories and products? “No.”)


What you will need to do to clean it up for a blank store so that the example store specific options/files don’t get in the way/confuse you or clutter things up.

You can see and play with the sample “Demo Store” at ZC’s free template demo site: ZenCartTemplates.info   Click “see demo” on any template, including the 1st one, the default.
Or, go to opensourcecms.com and choose “Demo Main Page:” to see and play with the demo store, then choose “Demo Admin Page:” (first, see the current id & password right below it) to explore and play with the admin area with all the demo settings.

After you tell ZC that you do not want the music, video, and computer “sample data” (“Store Demo”), ZC still insists on installing its “demo” music, video, and computer store files and database tables and records! … not to mention the zen-cart banner ads that are not removed. As it is, the pervasively embedded music programs throughout the zen-cart folder structure, makes it look as if ZC cannot function without them, or at least in the case of a music and video, store, it appears that all the extra programs and extra db tables and extra db records are necessary; that zc cannot function without them. That would be a severe short-coming, weakness, of zc if it were true. Worse is the implication that, for any other type of store, similar sets of specific, custom, programming could be necessary. That is not good. Fortunately, it is not true.
(the nightmare of trying to clean up the rest of ZC’s convoluted, “hidden”, text and settings, which are NOT in the .css file(s), is another, supplementary, issue. After this, see How to install-customize-personalize Zen-Cart)

Help with removing the rest of the “sample data” from zen-cart

Here is a list of zen-cart’s “sample store” files which should be removed – reminding anyone who questions it that you have enough copies of it all on you own pc, and you can un-zip another copy any time you wish. If for instance, there is an image you decide you would like to use, copy it in when you decide you want it, but not until then. (most will be found in your template anyway)

For example, in the images folder there are only 3 objects that you need: pixel_trans.gif, no_picture.gif, and the .htaccess file. All the sub-folders and all their images, etc., are a waste, and only cause you a hassle when you are trying to figure out which images are yours, and being used, and which are not yours, and not being used – except for those 3 things. Delete everything else in the /images/ folder. Give yourself a break.
I set up an on-line grocery store over a year ago. It now has over 1,000 images/products in over 3 dozen categories. None of those images or folders have ever been created or uploaded.

Then, these:
From a DOS Command shell in windoze, you can “cd” to the ZC folder (where you can “dir” and see the admin and includes and other folders – if you have already renamed the admin folder, you might rename it back just long enough to run these commands … or do a search and replace in this “script”), and then drag and drop the whole block of commands, below, all at once to the DOS “Command” line (or put them in a file and run it). Try the first line/command by itself to confirm your location, and, see if you are in the right folder/directory.

# 37+ files !

rmdir docs
del zc_install/demo/*.*
del media/*.*
del includes/media/*.*
rmdir includes/media
copy images/no_picture.gif media/no_picture.gif
copy images/pixel_trans.gif media/pixel_trans.gif
copy images/.htaccess media/.htaccess
del images/*.*
copy media/*.* images
del media/*.*
del download/*.*
del admin/includes/extra_configures/media_manager.php
del admin/includes/extra_datafiles/music_type_database_names.php
del admin/includes/extra_datafiles/music_type_filenames.php
del admin/includes/functions/extra_functions/product_music_functions.php
del admin/includes/languages/english/extra_definitions/product_music.php
del admin/includes/languages/english/media_manager.php
del admin/includes/languages/english/media_types.php
del admin/includes/languages/english/music_genre.php
del admin/includes/languages/english/product_music.php
del admin/includes/languages/english/record_artists.php
del admin/includes/languages/english/record_company.php
del admin/includes/modules/product_music/*.*
%del admin/includes/boxes/extra_boxes/product_music_extras_dhtml.php
rmdir admin/includes/modules/product_music
del admin/media_manager.php
del admin/media_types.php
del admin/music_genre.php
del admin/product_music.php
del admin/record_artists.php
del admin/record_company.php
del includes/extra_configures/media_manager.php
del includes/extra_datafiles/music_type_database_names.php
del includes/index_filters/music_genre_filter.php
del includes/index_filters/record_company_filter.php
del includes/languages/english/extra_definitions/product_music.php
del includes/languages/english/product_music_info.php
del includes/modules/media_manager.php
del includes/modules/pages/product_music_info/*.*
rmdir includes/modules/pages/product_music_info
del includes/modules/sideboxes/music_genres.php
del includes/modules/sideboxes/record_companies.php
del includes/templates/template_default/sideboxes/tpl_music_genres_select.php
del includes/templates/template_default/sideboxes/tpl_record_company_select.php
del includes/templates/template_default/templates/tpl_modules_media_manager.php
del includes/templates/template_default/templates/tpl_product_music_info_display.php

2 sideboxes and the ~”dhtml.php” file may no longer exist in version 1.5.0.
The 2 includes/modules/sideboxes/ files were called by 4 records in the layout_boxes table (see below) which needs to be deleted at the same time, to avoid error messages in the admin area (Tools, Layout-Boxes-Controller).

Note: In linux, an -rf is used to recursively force removing a folder and everything under it (there are 3 folders of junk listed below) otherwise, you will get an error message about them being directories, not files.

# 37+ files !

rm -rf docs
rm -rf zc_install/demo/
rm -rf includes/media/
rm -f media/*
mv images/no_picture.gif media/no_picture.gif
mv images/pixel_trans.gif media/pixel_trans.gif
mv images/.htaccess media/.htaccess
rm -rf images/*
cp -p media/* images/
rm -f media/*
rm -f download/*
rm admin/includes/extra_configures/media_manager.php
rm admin/includes/extra_datafiles/music_type_database_names.php
rm admin/includes/extra_datafiles/music_type_filenames.php
rm admin/includes/functions/extra_functions/product_music_functions.php
rm admin/includes/languages/english/extra_definitions/product_music.php
rm admin/includes/languages/english/media_manager.php
rm admin/includes/languages/english/media_types.php
rm admin/includes/languages/english/music_genre.php
rm admin/includes/languages/english/product_music.php
rm admin/includes/languages/english/record_artists.php
rm admin/includes/languages/english/record_company.php
# rm admin/includes/boxes/extra_boxes/product_music_extras_dhtml.php # (not in ver.150)
rm -rf admin/includes/modules/product_music/
rm admin/media_manager.php
rm admin/media_types.php
rm admin/music_genre.php
rm admin/product_music.php
rm admin/record_artists.php
rm admin/record_company.php
rm includes/extra_configures/media_manager.php
rm includes/extra_datafiles/music_type_database_names.php
rm includes/index_filters/music_genre_filter.php
rm includes/index_filters/record_company_filter.php
rm includes/languages/english/extra_definitions/product_music.php
rm includes/languages/english/product_music_info.php
rm includes/modules/media_manager.php
rm -rf includes/modules/pages/product_music_info/
rm includes/modules/sideboxes/music_genres.php
rm includes/modules/sideboxes/record_companies.php
rm includes/templates/template_default/sideboxes/tpl_music_genres_select.php
rm includes/templates/template_default/sideboxes/tpl_record_company_select.php
rm includes/templates/template_default/templates/tpl_modules_media_manager.php
rm includes/templates/template_default/templates/tpl_product_music_info_display.php

On your server, you probably have access to phpmyadmin where you can drop (delete) these excess tables and data.
Login to your webhosting control panel, open phpMyAdmin, select the Zen Cart database and click on the SQL tab. In the query box, drag and drop in the following drop, truncate, and delete commands (“queries”): (lines starting with # are comments)

DROP TABLE IF EXISTS media_clips;
DROP TABLE IF EXISTS media_manager;
DROP TABLE IF EXISTS media_to_products;
DROP TABLE IF EXISTS media_types;
DROP TABLE IF EXISTS music_genre;
DROP TABLE IF EXISTS product_music_extra;
DROP TABLE IF EXISTS record_artists;
DROP TABLE IF EXISTS record_artists_info;
DROP TABLE IF EXISTS record_company;
DROP TABLE IF EXISTS record_company_info;
#
# address_format
# 1 - Default, 2 - USA, 3 - Spain, 4 - Singapore, 5 - Germany, 6 - UK/GB
DELETE FROM address_format
WHERE address_format_id >= 3 ;
#
TRUNCATE TABLE banners ; # empty the whole thing. (all ads for ZC)
TRUNCATE TABLE banners_history ; # empty the whole thing. (all ads for ZC)
#
DELETE FROM configuration
WHERE configuration_title LIKE '%music%'
OR configuration_title LIKE '%record%' ;
#
# these 4 records call the 2 (music) sidebox generating programs
# in includes/modules/sideboxes/ both the db records and the sideboxes/pgms
# must be deleted before touching anything in Admin -> Tools -> Layout-Boxes-Controller
DELETE FROM layout_boxes
WHERE layout_box_name LIKE 'music%'
OR layout_box_name LIKE 'record%' ;
#
DELETE FROM product_types
WHERE type_name LIKE '%music%' ;
#
# 32 records!: 19-37, 86-90, 112-119.
DELETE FROM product_type_layout
WHERE configuration_key LIKE '%music%'
OR configuration_key LIKE '%record%' ;
#
DELETE FROM get_terms_to_filter
WHERE get_term_name LIKE 'music%'
OR get_term_name LIKE 'record%' ;


DELETE FROM twcc_zencart.admin_pages WHERE admin_pages.page_key = 'recordArtists';
DELETE FROM twcc_zencart.admin_pages WHERE admin_pages.page_key = 'recordCompanies';
DELETE FROM twcc_zencart.admin_pages WHERE admin_pages.page_key = 'musicGenre';
DELETE FROM twcc_zencart.admin_pages WHERE admin_pages.page_key = 'mediaManager';
DELETE FROM twcc_zencart.admin_pages WHERE admin_pages.page_key = 'mediaTypes';

Of course, ZC instructs everyone to remove the zc_install folder after installing zc.

If you want to look at some of the junk in the tables first, you can execute these commands (in phpmyadmin for example)

SELECT * FROM address_format WHERE address_format_id >= 3 ;
#
SELECT * FROM configuration
WHERE configuration_title LIKE '%music%'
OR configuration_title LIKE '%record%' ;
#
SELECT * FROM layout_boxes
WHERE layout_box_name LIKE 'music%'
OR layout_box_name LIKE 'record%' ;
#
SELECT * FROM product_types
WHERE type_name LIKE '%music%' ;
#
# 32 records!: 19-37, 86-90, 112-119.
SELECT * FROM product_type_layout
WHERE configuration_key LIKE '%music%'
OR configuration_key LIKE '%record%' ;
#
SELECT * FROM get_terms_to_filter
WHERE get_term_name LIKE 'music%'
OR get_term_name LIKE 'record%' ;


Store Demo
Would you like to install the Zen Cart demonstration categories and products?  Select “No”

Please select whether you wish to install the demo products into the database in order to preview the methods by which various features of Zen Cart operate. Select “No”


As an addendum, there are several folders that zen-cart demands full read-write access to (chmod 777 folder-name), but if you don’t intend to use them, you can set them back to read-only again, after you finish the install – with the one exception of images/
even if you set the images/ owner to apache, (and chmod 755 images) which gives php programs read-write authority, zen-cart will still complain in the admin area where you add or edit a product – claiming the images/ folder is unwriteable (not true) and it will not even try to upload and write the file to the images folder. This is one case where zc is not being intelligent about file access and security.

Tags:

3 Responses to Delete the Zen-Cart Store Demo files, images, and Data

  1. Stefan on July 1, 2012 at 5:22 pm

    Thanks for the great information, it really helped me. Only have a few small things that I noticed. It is worth mentioning to rename the admin folder back to admin if you already renamed it like I did(or change all the admins in the script to the new name).

    del includes/modules/sideboxes/music_genres.php
    del includes/modules/sideboxes/record_companies.php
    These 2 were also in my ZC 1.50 version


    Thanks. I added your note about admin. and the 2 files are listed.
    -ed

  2. Victor on May 1, 2019 at 4:44 pm

    Thanks for the great info! What is easier – to follow your way or to drop the db, purge files and reinstall ZC from scratch?

    Unless things have changed, the ZC install “from scratch” includes the junk no matter what you do.

  3. Victor on May 2, 2019 at 2:32 pm

    BTW, do you know Cube Cart? Can you compare Cube Cart to Zen Cart? I went through ZC files and all the garbage it has and I wonder is it sane to install it. Cube Cart is more modest, but it does not look bad. And I don’t need all this music garbage anyway.


    Right. all those music tables and data are only for demo-testing. ZC should but does not provide a simple 1-command-script to get rid of it. We have itemized all the music, images, data and tables, here so that you can get rid of it.

We try to post all comments within 1 business day