Changing the Default Currency

By: SethCardoza - Published: 2009-06-20 21:30:51 in Category: General

DigiSHOP is not one to let you do things on your own. The code has little comments, and none of them are useful to developers wanting to customize the shopping cart. As always, any customizations you make will void your warranty, so customize at your own risk.


If you have already installed your shopping cart, but want a different default currency than the current one, SumEffect says you need to call them and have them do it, or void your warranty. It's actually very simple to accomplish though. All it takes is a few changes to the settings.

First, connect to the database, and bring up the ds_settings table. For this tutorial, I am going to assume that the current default currency is USD. You will need to change the following settings, from their values below.

locale = "en_US"
locale.admin.date = "en_US"
locale.showIntCurrSymbol = "N"
mCountry = "United States"
merchantCountry = "US"
taxCountry = "US"

For this tutorial, I am going to change the default currency to Canadian dollars. I will have to change these settings as follows:

locale = "en_CA"
locale.admin.date = "en_CA"
locale.showIntCurrSymbol = "Y"
mCountry = "Canada"
merchantCountry = "CA"
taxCountry = "CA"

Really, not all of these settings need to be changed, but this will ensure fewer issues later on. The locale.showIntCurrSymbol setting only needs to be changed from N to Y if you want the international currency symbol to be displayed, instead of the dollar (US) sign. Further, the mCountry, merchantCountry and taxCountry only need to be changed if the store's billing address is located outside of the current country.

Submitting a Form With jQuery

By: SethCardoza - Published: 2009-05-05 13:59:32 in Category: General

On a recent project I was working on, I had to have a form submit when the option was changed on a select box. This is a simple task with jQuery. I just had to add a the change() event listener to the appropriate select boxes, and then submit the form. It didn't work though. The event listener worked, but the form would not submit. I tried several solutions, all pretty much the same in the end. None of them worked, and then I realized that I named my submit button "submit". It's a force of habit, something I do without even thinking. It is what caused my solution to break though. "Submit" is a reserved word and it prevented jQuery from submitting my form.

Naming your submit buttons "submit' is not a good idea anyway. It is a bad habit I have, and will now be broken from this point forth. Remember, if you want to submit your form with jQuery, don't name your submit buttons "submit". Better yet, avoid using reserved words at all.

Kona on the Indo Board

By: SethCardoza - Published: 2009-04-17 20:59:55 in Category: General

My dog, Kona, used to be terrified of my Indo Board. He wouldn't even go near it when it was stationary. But, a few treats and he rides on it with me now.

SVN - Creating a New Repository

By: SethCardoza - Published: 2009-04-07 14:29:52 in Category: Version Control

Creating a new repository with Subversion is simple. Just run the following command on your svn server:

svnadmin create /path/to/svn/example.com

This will create a new, blank repository with the name "example.com". Now you will want to do one of two things, import an existing project, or setup the initial directory structure for your new repository. To import an existing project, simply run the following command:

svn import /local/path/to/existing/project http://svn.example.com/path/to/svn/example.com

Now, if you are not importing an existing project you will want to setup your initial directory structure, most likely in the following fashion.

/path/to/svn/example.com/branches

/path/to/svn/example.com/tags

/path/to/svn/example.com/trunk

All you have to do is, checkout the project, create the necessary directories, and commit them to the repository. A friend of mine created a shell script to automate creating a new svn repository, and setting up the initial directory structure and/or importing an existing project.

SVN Copy - Creating a Branch or Tag

By: SethCardoza - Published: 2009-04-02 18:21:26 in Category: Version Control

Tagging and branching with svn are as simple as using the copy command. For this tutorial, I will assume that your repository has the following structure:

/path/to/repository/branches

/path/to/repository/tags

/path/to/repository/trunk

To create a tag of the trunk, run the following command:

svn copy http://svn.example.com/path/to/repository/trunk http://svn.example.com/path/to/repository/tags/snapshot-of-trunk

To create a tag of your current working copy (assuming you are in that directory on your local machine):

svn copy . http://svn.example.com/path/to/repository/tags/working-copy-seth

To tag a branch, say before merging the branch back into the trunk, run the following command:

svn copy http://svn.example.com/path/to/repository/branches/branch-seth/ http://svn.example.com/path/to/repository/tags/snapshot-branch-seth

To create a branch of the trunk:

svn copy http://svn.example.com/path/to/repository/trunk http://svn.example.com/path/to/repository/branches/branch-seth

To create a branch of your current working copy:

svn copy . http://svn.example.com/path/to/repository/branches/branch-seth

Tags should only be used to create snapshots of the repository. No development should be done on a tag, meaning you should never commit code to a tag. Branches are used for development that you do not want to interfere with everyday activity. They can be used for experimental code, code that you may only want to have run on your local machine, but still would like to have the power of version control behind your code. There are many other situations in which you would want to use a tag or a branch. You can read more about subversion and tags and branches on Wikipedia.