osCommerceCoders.com

Affordable end to end oscommerce solutions with
Search Engine Optimization

Email : osCommerceCoders@gmail.com
Call : +1 818-574-3596 (USA) / +44 (020) 8123-6463 (UK)

Archive for June, 2010

===================
Step-by-Step SETUP:
===================

STEP (1): Set the location for your store:

Configuration –> My Store

– Country: Canada
– Zone: Ontario

========================================================

STEP (2): Create the “Tax Zones”. The are geographical regions where a particular set of tax laws applies

Locations/Taxes –> Tax Zones

Create the Zone for all of Canada
– Zone Name: Canada GST Zone
– Description: GST (most of Canada except NS, NB, NL)

Now click on the newly created “Canada GST Zone” row to drill down one level to “Sub Zones”
Click INSERT to create 10 new sub-zones, one at a time:

– Country: Canada; Zone: Alberta
– Country: Canada; Zone: British Columbia
– Country: Canada; Zone: Manitoba
– Country: Canada; Zone: Northwest Territories
– Country: Canada; Zone: Nunavut
– Country: Canada; Zone: Ontario
– Country: Canada; Zone: Prince Edward Island
– Country: Canada; Zone: Quebec
– Country: Canada; Zone: Saskatchewan
– Country: Canada; Zone: Yukon Territory

==============

Click on “BACK” to go up one level.
Now create the Ontario Provincial Tax Zone:
Click Insert

– Zone Name: Ontario PST Zone
– Description: PST (only when shipping to Ontario)

Now click on the newly created “Ontario PST Zone” row to drill down one level to “Sub Zones”
Click INSERT to create new sub-zone:

– Country: Canada
– Zone: Ontario

==============

Click on “BACK” to go up one level.
Now create the HST Tax Zone:
Click Insert

– Zone Name: HST Zone
– Description: NS, NB, NL

Now click on the newly created “HST Zone” row to drill down one level to “Sub Zones”
Click INSERT to create new sub-zone:

– Country: Canada; Zone: Nova Scotia
– Country: Canada; Zone: New Brunswick
– Country: Canada; Zone: Newfoundland

==============

Do NOT create a seperate Tax zone for Shipping. You will simply use the “Canada” tax zone for the GST Shipping tax class (below).

*** Important: this means that SHIPPING GST will only be charged to destinations within Canada,
*** but NOT charged on exports.
*** According to Canada Customs & Revenue Agency (1-800-959-5525), you do *NOT* charge GST
*** on the shipping fee for EXPORTS.

========================================================

STEP (3): Create the “Tax Classes”

Note: You can only assign ONE
Tax Class to a product. But since we want shipping gst to
show up seperately, we will make a seperate Tax Class just for it.

Locations/Taxes –> Tax Classes

create TWO (2) tax classes:

– Tax Class Title: GST/HST/PST Class
– Description: All taxable goods

– Tax Class Title: GST Shipping class
– Description: GST on shipping within Canada

========================================================

STEP (4): TAX RATES

Here is where it all comes together: Tax Rates.
Tax Rates associate Tax Zones & Tax Class to determine
the correct Tax Rate.

HINT: The “DESCRIPTION” is what shows up on the invoice
so use it judiciously!!!!!!!!!!!!!

Locations/Taxes –> Tax Rates

create SIX (6) Tax Rates:

– Tax Class Title: GST/PST/HST Class
– Zone: Canada GST Zone
– Tax Rate (%): 7.0000
– Description: 7.0% GST#99999 99999 RT0001
– Priority: 1

/*HINT: Insert your GST# as part of DESCRIPTION and it will show up on invoice !!!
/*HINT: Leave PRIORITY at “1” for a non-cumulative tax (i.e. Ontario)

– Tax Class Title: GST/PST/HST Class /* HINT: Yes, this is the same one you just used
– Zone: Ontario PST Zone
– Tax Rate (%): 8.0000
– Description: 8.0% PST (Ontario)
– Priority: 1

/*HINT: Leave PRIORITY at “1” for a non-cumulative tax (i.e. Ontario)
but change to “2” for cumulative tax (i.e. You are a Quebec store)

– Tax Class Title: GST/PST/HST Class /* HINT: Yes, this is the same one you just used
– Zone: HST Zone
– Tax Rate (%): 15.0000
– Description: 15% HST#R99999 9999 RT0001
– Priority: 1

That takes care of taxes on products. And now, the Shipping taxes:

– Tax Class Title: GST Shipping Class
– Zone: Canada GST Zone
– Tax Rate (%): 7.0000
– Description: 7.0% GST on shipping
– Priority: 1

– Tax Class Title: GST Shipping Class
– Zone: Ontario PST Zone
– Tax Rate (%): 8.0000
– Description: 8.0% PST (shipping)
– Priority: 1

– Tax Class Title: GST Shipping Class
– Zone: HST Zone
– Tax Rate (%): 15.0000
– Description: 15% shipping HST#99999 9999 RT0001
– Priority: 1

/* HINT: The above will calculate PST on shipping. Although there might
/* be a tendenancy to think of shipping as a PST exempt service, in fact
/* the Ontario Ministry of Finance says that for cacluating the PST,
/* “The total selling price includes delivery, mailing, transportation, or
/* handling charges, but does not include the GST”. With the above set-up,
/* the PST for the shipping gets calculated (albeit seperately). If you wanted them
/* calculated together, you could assign “GST/PST/HST Class” as the
/* Tax Class when setting up the shipping method. Personally, I prefer
/* to break it out seperately.

========================================================

STEP (5): Specify the appropriate Tax Class for SHIPPING MODULES

MODULES –> SHIPPING

Edit whichever shipping module(s) you are using.

Tax Class: GST Shipping Class

/* SEE PREVIOUS HINT

========================================================

STEP (6): Specify the appropriate Tax for PRODUCTS

This may take some time….

CATALOG –> Categories/Products

Drill down to each product. Click EDIT

TAX CLASS: “GST/PST/HST CLASS”

========================================================

===============
Example Output:
===============

Shipping to Ontario:

Sub-Total: $69.00
Per Item (Best Way): $10.00
8.0% PST (Ontario) + 7.0% GST #99999 9999 RT0001: $10.35
7.0% GST (shipping) + 8.0% PST (shipping): $ 1.50
Total: $90.85

Shipping into the HST zone (NB, NS, or NL):

Sub-Total: $69.00
Per Item (Best Way): $10.00
15% HST#R86179 1655 RT0001: $10.35
15% shipping HST#99999 9999 RT0001: $ 1.50
Total: $90.85

Shipping to Canada, but non-HST, and non-Ontario:
Sub-Total: $69.00
Per Item (Best Way): $10.00
7.0% GST # 99999 9999 RT0001: $ 4.83
7.0% GST (shipping): $ 0.70
Total: $84.53

Shipping to non-Canada zone:
Sub-Total: $69.00
Per Item (Best Way): $10.00
Total: $79.00

If you need help in setting it up we charge a nominal fee of 50 USD for setting up the Canadian Tax for the store.

You can order the package and get it started.

50 USD










osCommerce has a problem when editing an existing manufacturer’s information. If a new manufacturer image is not loaded at the same time then the image that was there previously disappears. osCommerce also fails to delete a manufacturer’s image from the server when the manufacturer is deleted.

The solution to the problems is simple. Open the file admin/manufacturers.php

Find the following lines around line 41:

if ($manufacturers_image = new upload(‘manufacturers_image’, DIR_FS_CATALOG_IMAGES)) {
tep_db_query(“update ” . TABLE_MANUFACTURERS . ” set manufacturers_image = ‘” . $manufacturers_image->filename . “‘ where manufacturers_id = ‘” . (int)$manufacturers_id . “‘”);
}

Replace them with the following lines:

$manufacturers_image = new upload(‘manufacturers_image’);
$webimgtypes = array (‘bmp’, ‘jpg’, ‘jpeg’, ‘gif’, ‘png’);
$manufacturers_image->set_extensions($webimgtypes);
$manufacturers_image->set_destination(DIR_FS_CATALOG_IMAGES);
if ($manufacturers_image->parse() && $manufacturers_image->save()) {
tep_db_query(“update ” . TABLE_MANUFACTURERS . ” set manufacturers_image = ‘” . tep_db_input($manufacturers_image->filename) . “‘ where manufacturers_id = ‘” . (int)$manufacturers_id . “‘”);
}

Find the following around line 77 (line 81 if you’ve made the previous change already)

$image_location = DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG_IMAGES . $manufacturer[‘manufacturers_image’];

and replace it with the following:

$image_location = DIR_FS_CATALOG_IMAGES . $manufacturer[‘manufacturers_image’];

Save your work and you are done.
Cheers

This is because of the free gifts addon of oscommerce store. this is a mysql 5 fix.

Need to change 2 files

Fix 3 files:
shopping_cart.php
Edit the line to:
$gift_query = tep_db_query(“SELECT fg.*, p.products_id, p.products_model, p.products_price, p.products_image, p.products_status, pd.products_name FROM (” . TABLE_CARROT . ” fg, ” . TABLE_PRODUCTS . ” p)
LEFT JOIN ” . TABLE_PRODUCTS_DESCRIPTION . ” pd ON (pd.products_id=fg.products_id)
WHERE pd.language_id = ‘”.$languages_id.”‘ AND p.products_id = fg.products_id AND p.products_status = ‘1’ ORDER BY fg.threshold ASC”);

admin/gift_add.php
Edit the line to:
$gift_query = tep_db_query(“SELECT fg.*, p.products_id, pd.products_name FROM (” . TABLE_CARROT . ” fg, products p)
LEFT JOIN products_description pd ON (pd.products_id=fg.products_id)
WHERE pd.language_id = ‘”.$languages_id.”‘
AND p.products_id = fg.products_id
ORDER BY fg.threshold ASC”);

If you need commercial support in fixing it you can use the contact us form in the site.

Sponsors