Zen Cart Cookbook http://zencart.posterous.com all about building e-commerce site with Zen Cart posterous.com Sun, 08 Feb 2009 08:44:42 -0800 Create a New Zen Cart Template http://zencart.posterous.com/create-a-new-zen-cart-template http://zencart.posterous.com/create-a-new-zen-cart-template

Whenever you create a Zen Cart based e-commerce site, you need to change one thing, at least. It is site's look and feel. If you use Zen Cart's default theme, that will show your site in a common look, which is a barrier for branding your shop. You need to change the look of your site. You can do it by two ways: use some third-party templates designed for Zen Cart, or develop a template for Zen Cart at your own. In my book Zen Cart: E-commerce Application Development, I have tried to describe how to build a Zen Cart template. A full chapter is dedicate on building a template and customization of existing templates. My publisher, Packt Publishing, has kindly made the chapter available to public. Please read the article Creating a new Zen Cart template.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1362115/10150252310050081.jpg http://posterous.com/users/PV2Dlc35zX Suhreed Sarkar suhreed Suhreed Sarkar
Thu, 05 Feb 2009 05:03:00 -0800 Create coupons in Zen Cart: Video Tutorial http://zencart.posterous.com/create-coupons-in-zen-cart-vid http://zencart.posterous.com/create-coupons-in-zen-cart-vid

One of the great features of Zen Cart is to configure coupons and sending those to the customers. The coupons in Zen Cart can be used for discount by the customers. In Zen cart, you can also sell coupons as gift certificate. To learn, how to create a coupon in Zen Cart, view the video below.

For a step-by-step guide on building a Zen Cart e-commerce site, including configuring coupons and gift voucher, read the book Zen Cart: E-commerce Application Development, published by Packt Publishing

.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1362115/10150252310050081.jpg http://posterous.com/users/PV2Dlc35zX Suhreed Sarkar suhreed Suhreed Sarkar
Wed, 04 Feb 2009 21:10:00 -0800 Installing Zen Cart http://zencart.posterous.com/installing-zen-cart http://zencart.posterous.com/installing-zen-cart

Before installing Zen Cart on your server, ensure that you have the required server environment. As prerequisites, you need a web server that can support PHP and run MySQL database server. The following sections describe the prerequisites for installing Zen Cart in more detail.

The minimum recommended server requirements for Zen cart installation is:

  • PHP 4.3.2 or higher (PHP 4.4.x for optimal performance),
  • Apache 1.3.x and higher; and
  • MySQL 3.2.x or higher.

Although  Register Globals may be on or off, it is recommended to keep safe_mode off. For many shipping and payment modules, CURL has to be installed/compiled with PHP.

Support for HTTPS may be required depending on the payment methods being accepted. The use of SSL during account creation and check out is also recommended.

At present, Zen Cart does not officially support PHP5. However, many shops are successfully running on servers, using PHP5. In August 2007, it was announced on Zen Cart's website that Zen Cart version 1.4 and higher will require PHP 5.2 as the minimum.

Web Server

You can use Zen Cart on Apache, Microsoft IIS and other web servers that can support PHP. If you are using Zen Cart for development or testing purposes, you may have local web servers such as Apache or IIS installed. For live shops, you must have a web server running for live websites. You may have a dedicated web host server or a shared web server for hosting. There are a lot of web hosting companies offering budget web hosting on Linux-Apache-MySQL-PHP hosting. On windows server, PHP or MySQL may not be available in a standard hosting package.

For your local computer, you may install web server, PHP and MySQL server separately, or install one of the following bundled packages :

  • WAMP: WAMP is a package of Apache-MySQL-PHP for Windows computers. You can download it from http://www.wampserver.com and install it as a windows application. You can get Apache, MySQL and PHP running within a few minutes. You will also have phpMyAdmin pre-installed to administer MySQL databases.
  • EasyPHP: EasyPHP, a package of Apache-MySQL-PHP, is simple to install and use. You can download it free of charge at http://www.easyphp.org.
  • XAMPP: XAMPP is an easy-to-install Apache distribution containing MySQL, PHP and Perl. XAMPP is very easy to install and use just download, extract and start. You can download a version for Linux, Windows, Mac, or Solaris. It is available at http://www.apachefriends.org/en/xampp.html.

Installing any of these packages will ease your administration task for web server and MySQL database. However, you are free to install and configure Apache, MySQL, and PHP separately.

If you are playing around with Zen Cart, I recommend using a development server. You will also need a development environment for customizing themes and testing third party contributions. In Linux, you can set it up by installing Apache, MySQL, and PHP packages. For Windows machines, you need to use one of the above-mentioned Apache-MySQL-PHP packages. In Appendix A, we will show how to set up a development environment by installing and configuring WAMP on a Windows machine.

PHP

If you plan to use Zen Cart, I am sure that you know about PHP. PHP is the hot scripting language for the web. You can get the latest version of PHP from www.php.net. You can download and install PHP package with your web server. For IIS, PHP can be configured as CGI or ISAPI; you can use either modes. For Linux, Apache-PHP-MySQL is installed by default. If you use WAMP, EasyPHP, or XAMPP web server package, you don't have to install and configure PHP separately.

Database

At present, Zen Cart supports only MySQL. MySQL version 4.1.x is recommended. However, Zen Cart can run on MySQL 5 server, but advanced features of MySQL 5 cannot be used in Zen Cart tables.

The data structure of Zen Cart is given in the mysql_zencart.sql file located in the zc_install/sql directory. Database tables will automatically be built during installation. However, you have to create the database and the user for login to that database before hand.

If you have installed WAMP or XAMPP, you will get MySQL server installed automatically. You can also use phpMyAdmin for managing databases in MySQL server. If you are using Linux hosting and cPanel, you can also use cPanel's database management tool and phpMyAdmin to create, delete, and manage databases and users.

Step-by-Step Installation

Once all prerequisites have been met, you can proceed to the installation of Zen Cart. The following sections describe the installation process for Zen Cart systematically, by using Fantastico and by uploading files to the server.

Through Fantastico

Fantastico is an excellent tool for installing a number of PHP applications on a server. Most of the Linux hosting services will give you access to your account through cPanel. Along with cPanel, you may also get Fantastico support. One of the benefits of installing a PHP application using Fantastico is that you don't need to bother about creating databases and uploading Zen Cart files separately.

Step-by-step guidelines for installing Zen Cart using Fantastico are given below:

1. Login to cPanel and click on the Fantastico icon.

2. A list of available PHP applications will be displayed. Go to the E-commerce section and click on Zen Cart link.

3. A short description of Zen Cart, current installations, and a link for new installation will be displayed. You will be informed about the space required for the new installation too. Click on the New Installation link to install Zen Cart.

4. Zen Cart installation will be shown. Then , you have to provide the following information:

  • Install on domain: Select the domain on which Zen Cart will be installed. If you have a sub-domain of, say, shop.yourdomain.com, you can select it, or you can install on yourdomain.com domain.
  • Install on directory: Enter the name of the directory on which Zen Cart will be installed. The directory should not already-exist; Fantastico will create a new one. If you want to install Zen Cart in the shop directory under your domain's root directory, just type shop in this field. Keep it blank to install it in that domain's root directory.
  • Administrator-username: Enter the name of administrative account. This will be used to login to Zen cart administration panel.
  • Password: Enter a password in this field. This will be needed to access the administrative panel.
  • Site name: Give your shop an attractive name, which will be displayed in the browser title bar.
  • Admin email: Enter the email address of the administrative user. All emails regarding administration will be sent to this address. If you forget the administrator account's password, a new password will be sent to this email address.

5. Once these fields are filled in, click on the Install Zen Cart button.

 6. On clicking Finish Installation, the required files are copied to the target directory and a database is created with a user and password. The configuration file for Zen cart will also be created automatically. Then, a screen will indicate that you have installed Zen Cart successfully. You can notify others about this installation by entering their email address and pressing Send E-mail Button. You will also see links to your shop catalog and the administrative area in this screen.

By Uploading Files

If you do not have Fantastico, do not worry. You can easily install Zen Cart by uploading the required files to the web server. Before doing this, you must download the latest version of Zen Cart from www.zen-cart.com. Unzip the zipped or gzipped package on your computer. Then, create the directory on your web server's webroot, and a database for Zen Cart on the MySQL server. Also, configure a database user to have the appropriate permissions (SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, INDEX, DROP ) on this database. If you are using  cPanel, you can use its tools such as  phpMyAdmin for this.

You need  an FTP program for uploading files to the server.  FileZilla is a nice choice for this.

Web hosts have their preferences in naming folders for running a website. You can have many files that don't even get shown to the public. The ones that are available for access via a browser are usually in a specific folder, for example, /home/yourname/public_html or /var/www/yourname/httpdocs or /usr/accounts/a/b/yourname/httpd and so on.

You need to upload your files to one of these folders. If you want the shop to be in a directory different to that of the webroot, you must create a directory, say shop, in the webroot.

Before running the installer, you need to know the following facts:

You must take note of these paths before starting the installation. You should also know your database name, username, and the password to access it. You have now uploaded the files to the shop directory, and you will use it for the following examples.

Once you have all of the information at hand, and have completed uploading all the files to the web server, you must start the installation with the following steps:

1. Open the browser and point to http://www.yourdomain.com/shop/zc_install/. You will find the following Zen Cart Setup, Welcome screen.

2. You can see a brief description in the Welcome page. To see the full description, you must scroll down and click on the Continue button to start the installation. On clicking the Continue button, the following License Confirmation page is shown:

3. Zen Cart uses GNU General Public License (GPL). To accept the licensing conditions, you must read and select I have read and agreed to abide by the Terms and Conditions as stated above. On clicking the Continue button, the System inspection screen will be shown.

4. The System Inspection screen will show your server environment variables. Variables suitable for Zen Cart installation are shown in green. Any variable configuration not suitable for Zen Cart installation will be shown in red. To know about that variable's desired configuration click on Click here for more info link. If you find any variable in red, you must reconfigure it on your server and click on the Recheck button at the bottom. If everything is alright, then click on the Install button. The following Database Setup screen is then shown:

5. In the Database Setup screen, you have to configure the following options for the database:

  • Database Type: Select the type of database to be used for the Zen Cart shop. At present, you can only select MySQL as the Database Type.
  • Store Identifier (Table-Prefix): If you are using the same database for another application, it is better to separate Zen Cart tables with a prefix. Type a prefix for the tables, for example, zen, in this field.
  • Database Host: Enter the database server's name in this field. Usually, it is localhost. If not, you can enter the hostname as dbserver.yourdomain.com in the Database Host field.
  • Database Username': For connecting to the database, you need a database username. Remember that for shared hosting on the linux server, the username used to log into cPanel is prefixed to the database username, for example suhreed_zen, where suhreed is the account on that server, and zen is the database username.
  • Database Password': Enter password for that database user in this field. This password must match with the existing database user's password.
  • Database Name: You have to specify the name of the database that will be used for the Zen Cart Shop, for example, zencart or yourname_zencart. You must provide the name of an existing database. Therefore, you need to create this database beforehand. However, Zen Cart Setup can create the tables in the database.
  • Database Sessions: You can store your session information in the database or separate file system. For storing sessions in the database, select Yes in this field.
  • SQL Cache method': Caching SQL queries improves the performance of the Zen Cart shop. You can store SQL queries in the database or in file systems. Select the method that you want to use.
  • Session/SQL Cache Directory': If you select a file system as SQL Cache method, specify the directory to be used for caching. By default, this is the cache directory under the Zen Cart installation.

 



This article has been extracted from: Zen Cart: E-commerce Application Development

Zen Cart: E-commerce Application Development

A step-by-step developer's guide

  • Install, configure, and customize Zen Cart for your customers
  • Enhance and modify Zen Cart
  • Walk through the creation of a fully functional book store
  • Learn advanced features of Zen Cart with practical examples

For more information, please visit:
http://www.PacktPub.com/zen-cart-ecommerce-application-development/book

 


6. Click on the Save Database Settings button to proceed to the next step. The installation process will create the database structures for Zen Cart. You will see an Installation in progress message while the database creation is ongoing. Once the database creation is complete, the following System Setup screen is shown:

7. You have to provide some more information on the System Setup screen. First, enter the physical path to your Zen Cart directory in the Physical Path field. This will look like /home/Suhreed/public_html/shop or, for windows host, e:/www/shop. Then, enter the virtual path/URL of your Zen Cart shop in URL to your Zen Cart store field, For all paths, do not include a trailing slash, '/ ' at the end of the path. For an explanation of a fields, click on the more info link beside the field. In the SSL Details section enter the URL of virtual directory for secure Zen Cart shop in HTTPS Domain field. The full virtual path of this secure directory should be mentioned in HTTPS Server URL field. If you want to use SSL to provide enhanced security for your shop, select Yes in the Enable SSL field. Select Yes in the Enable SSL in Admin Area field if you want to use SSL for access to the admin section. Usually, this screen will show the detected values for your server as defaults. Click on the Redetect defaults for this host button to get new values for these fields. Once you have entered all required paths and configurations, click on the Save System Settings button. The following phpBB Setup screen is shown:

8. The phpBB screen gives you an option to integrate the phpBB forum with your shop. If you want to use phpBB with Zen Cart shop, select YES and then type the path of the phpBB installation in phpBB Directory field. You can get an explanation of these setting by clicking on the more info link. Now, click on the Save phpBB settings button. The Store Setup screen is shown.

9. In the Store Setup screen, you must provide the Store Name, Store Owner, Store Owner Email, Store Country, Store Zone, Store Address, Default Language and Default Currency. Zen Cart comes with some example products and categories. To load these demo categories and products, select Yes in the Store Demo field. If you want to build a completely new product catalog, select No. Once these options are configured, click on the Save Store Settings button to proceed to the next step. The Administrator Account Setup screen appears, as shown below:

10. In the Administrator Account Setup screen, enter an Administrator's Username, Administrator's Password and Administrator's email. These will be used to login into the Administration panel for your shop. You have to confirm the administrator's password by retyping it in the Confirm Administrator's Password field. If you select Check for Zen Cart updates when logging into Admin, you will be notified about new versions of the Zen Cart release when you (as the administrator) log on. Click on the Save Admin Settings button.

11. Now, the Zen Cart Setup Finished screen is displayed. This screen will congratulate you on the successful installation of Zen Cart. It will also tell you about the next steps setting permissions to the configure.php file, zc_install and admin/includes/ folders. It will also show you some links for getting help. At the bottom of this page, you will see two buttons: Click here to go to the Store and Click here to open the Admin area. First check the store, and then try the admin area. You are going to explore these in a few minutes.

Conclusion

That's all. You have installed Zen Cart. Now it's time to explore the store and it back-end administration panel.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1362115/10150252310050081.jpg http://posterous.com/users/PV2Dlc35zX Suhreed Sarkar suhreed Suhreed Sarkar