Monday, May 23, 2011

change the category page layout

(1) In file skins\basic\customer\views\categories\view.tpl line 142 (2) In skins\basic\customer\style.base.css add

Saturday, May 21, 2011

Add facebook & twitter share function into product detail page

(1) goto http://www.addthis.com/ to get the script code. You can customize your share links for facebook and twitter only.

(2) In skins\basic(or your skin template)\customer\blocks\product_templates\default_template.tpl
around line 88 add the generated script code from step 1.

See the example picture

Friday, May 20, 2011

New York States Tax Setup

For many e-commerce shopping cart website, New York State tax function is a big issure. I wrote a program to calculate the lattidue and longtitude for each New York State zipcode, and get the following table data for "How-To charging the New York State sales tax". You have to add 11 locations for 11 different tax rates. Then you are able to charge the different tax rate for different location.

Wednesday, May 18, 2011

linux server shell script to backup and restore cs-cart database

To display current scheduler jobs listing
crontab -l

To add or edit the scheduler jobs
crontab -e


Backup
Using vi to create a shell script file to run at crontab scheduler
vi wwwbackup.sh
chmod 777 wwwbackup.sh /* change the script file to exexcutable */

#!/bin/sh
fn=`date +%Y%m%d`
mysqldump -hlocalhost -uUSERNAME -pPASSWORD DATABASE > /var/www/vhosts/yourdomain.com/private/backup/dbbackup_$fn.dump
tar cf /var/www/vhosts/yourdomain.com/private/backup/cscart/$fn.files /var/www/vhosts/yourdomain.com/httpdocs

Restore
mysql -u root DATABASE < dbbackup_yyyymmdd.dump

Tuesday, May 10, 2011

Change the Skins

You can change the cs-cart skin by go to administration panel, design section, then click "skin selector" to change your web store layout.

There are some build-in skins that you can use. I prefer the "toy store".

After you select the skin, you can modify it at skins\customer folder.
The required skills are:
(1) PHP
(2) CSS
(3) HTML
(4) smarty php template engine.

Monday, May 9, 2011

cs-cart, how to add a new "how to use" tag into product detail page

How to add a new "how to use" tag into product detail page
(1) create file, skins\basic\customer\blocks\product_tabs\howtouse.tpl
{* $Id: description.tpl 11191 2010-11-11 11:56:01Z klerik $ *}
{** block-description:howtouse **}
{$product.howtouse|default:$product.short_description|unescape}

(2) add a language variable "howtouse" => How to Use
(3) add a howtouse field into table cs_cart.product_description table
(4) In skins\basic\admin\views\products\update.tpl
line 55 add following code

Adding a expand dropdown menu in cs-cart

(1) In schemas\static_data\schema.php line 90
add array( 'title' => 'popup_direction',
'type' => 'select', 'name' => 'param_4',
'values' => array( 'right' => 'right', 'left' => 'left', 'expand' => 'expand' ),

(2) In language variable add expand => Expand

(3) In Top Menu section, Pop-up direction, select "expand"

(4) In skins\your_skin\customer\top_menu.tpl line 3 change to:
(5) You should able to get the expand dropdown menu as,

Sunday, May 8, 2011

How to add a user to process orders only?

Sometimes, you only want your employee to process the customers' orders. Then you have to create a administrator user account and delegate the rights.

(1) In administration panel -> Users -> User Groups page, click "Add User Group"

(2) enter user group name, and select type as "Administrator", then click "create"

(3) Click the "privileges" next to Super to setup the access right

(4) You can check or uncheck the check-box to enable or disable the access rights

(5) Add a administrator from "Users" -> "Users" page by clicking "add administrator" button

(6) After a new user is created, you can edit this user and select the "Super" user group to this new added user.

Saturday, May 7, 2011

How to setup cs-cart home page's title and meta description

In CS-Cart 2.1.4, users have hard time to find where to setup their home page's title, meta keyword, and meta description.

After I asked the cs-cart support, I know where to setup my home page title now.
(1) select "Design", "Blocks", "Home Page"
(2) click the small icon next to "Home page"

(3) You should able to see a window popup as below