How to add images to Drupal Ecommerce

Ajay on January 12th, 2008

Well if you are coming from a a traditional shopping cart background then you will be surprised to know that Drupal Ecommorce doesn’t allow you to add/upload images easily.

Don’t be disappointed, there is a way..

Step 1: Install Image Module

http://drupal.org/project/image

Enable it from Admnister->Site building -> Modules

Step 2: Add an Image

From Create content create an image as you do for pages etc.

In the title add the product name.

Uplaod image

In Body write the product description

Fillup/check/uncehck the option you require

Step 3: This is the key..

In the Product section Select a product type, e.g. Shippable Product and click Add to store

This step will convert (rather promote and image to become a product or whatever you wish to say)  an image into a prdocut.

This was simple wasn’t it?

N’joy Drupaling

See this in action on my live online PC Shop www.SwamiPC.co.uk

Drupal ecommerce

Ajay on

Drupal ecommerce is a full shopping cart which can be integrated with Drupal CMS.

Drupal Ecommerce Home Page

http://www.drupalecommerce.org/ 

Drupal ecommerce module home page

http://drupal.org/handbook/modules/ecommerce

How to disable displaying web site name in header?

Ajay on December 26th, 2007

By default Drupal displays the web site name along with logo.

I’m still exploring the easiest way to disable it being displayed.

One quickest way is to comment out it from the .php file. To do so open page.tpl.php file in your theme folder and search for following line

<?php print $site_name; ?></a>

Modify this line as below

<?php //print $site_name; ?></a>

That’s it.

How to move Drupal from one host to another

Ajay on

Basically moving any php based open source packages from one host to another involve more or less same pattern.

Here I’ll explain how to move Drupal from one host to another.

Before you start working on it backup your files and database.

Step 1: Move files

The first step is to move all your files from one host to another by either using ftp or any other means as supported by your host.

Step 2: Move database (I’ve taken example of mysql database)

The 2nd step is to move database.
a) To move database first Export drupal database and save it as .sql

b) Then on your new host create a database from control panel or phpMyAdmin or any other means provided by host.

c) Then Import the .sql which you exported in step (a). You can do it either by phpMyAdmin or from SSH or any other means whichever is available to you.

Step 3 : Point Drupal on new host to the newely created database in Step 2

a) Database settings

When you moved your files in step 2, your Drupal installation still carries the references to old host.

You need to modify sites/default/settings.php file to use new database. To do so

Change the settings.php file permissions to make it writable. By default it is read only.

Open settings.php in any text editor.

Search for a line which is starts with

$db_url = ‘mysql:

This is the variable where you set the new database, username and password

The format of this line is:

$db_url = ‘mysql://username:password@localhost/databasename

Modify this line according to new database, username and password.

Make sure that the localhost is indeed your mysql host. In 99% it will be so, but if your host is 1and1 then you need to find your host from mySQL administrator and replace the lcoalhost also with the mysql host name which would be something db9131.oneandone.co.uk

b) Base URL change

If you have also changed your domain then you will need to modify following lines in settings.php file to have your domain.

$base_url = ‘http://www.example.com’;  // NO trailing slash! 

If you see any # at the beginning of this line then get rid of it.

Enjoy!!

Drupal SEO

Ajay on

Before you go for advance configuration of Drupal SEO, install SEO Checklist module.

This is an excellent SEO module which will enable you to analyze your SEO requirements.

After installing SEO Checklist module configure it from Administer->Site configuration->SEO checklist

Follow the instructions there.

Followings are the modules required for SEO

Page Titles
  Download

URL paths
  Download

  Download

  Download 

  Download

Track your visitors

  Download

Page content
  Download

  Download

  Download

  Download

  Download

  Download

Social Tracking

  Download

  Download

Protect your site from Spam

  Download

  Download

  Download

  Download 

Beta Modules (Use with Caution!)

  Download 

Line break < br / > doesn’t work in pages edit

Ajay on

This seems to a kind of head scratching experience not only for Drupal but also for WordPress, or anywhere you are using any kind of html editor.

I’m using fckeditor with Drupal and faced this problem.

The line break doesn’t work and whole text formatting disappears in the page.

However I couldn’t find an ultimate solution but I got it working.

First thing you need to do is make sure that you are using full HTML Mode

Admin->Adminster->Site configuration and select Full HTML

Next make sure that you are editing the page contents from Admin side and not from the front side as Admin user.

Check admin/content/node in your URL to make sure that you are in Admin while editing contents.

It works for me :)

Also just realized that while editing a page make sure that you have selected FULL HTML under Input Format.

How to change the default front page in Drupal

Ajay on December 25th, 2007

With my first Drupal installation I have to struggle to change the default home page. This is relatively a very simple task, which I later found out.

To change the default home page in Drupal

1) Create a Home page from Create Content->Page

a) Enter the Title

E.g. Home

b) Enter text in the Body (you can modify it later)

c) Under URL path settings enter Home (or any similar name of your choice to identify it, which you will require in 2nd step)

d) Under Publishing option check the Published and leave rest of check boxes unchecked

2) Under Administer->Site configuration->Site information

Scroll down to Default front page: 

Enter Home (or whatever name you have given in step 1.a)

Click Save configuration and you are done.

How to remove breadcrumb from Drupal

Ajay on

By default you will see a breadcrumb appearing just below the main menu.

To disable it search for breadcrumb class in the style.css in the themem folder which you have installed.

E.g. for aberdeen the style.css  will be in themes/aberdeen folder

Replace following (Or something similar)

.breadcrumb {
margin: 0 0 1.3em 0;
}

by

.breadcrumb {display: none;} 

and enjoy :)