These tools/software are very important for any on-line stores:

Goolge Analytics (http://www.google.com/analytics/)
Goolge Webmastertool (http://www.google.com/webmasters/tools/)
Google Product Search (http://base.google.com/)
Add and submit Site Map
Add SEO url
Submit url

  • Google -http://www.google.com/addurl/
  • Yahoo - https://siteexplorer.search.yahoo.com/submit
  • MSN Live Search - http://search.msn.com.sg/docs/submit.aspx

They should be implemented as soon as feasible.

Here is Canpar Shipping Module adapted to work with the MVS (Multi Vendor Shipping) Module:

/*
canpar.php,v 0.1 2006/07/22 10:52:11 hpdl Exp $ ORIGINAL CANPAR SCRIPT
Copyright (c) 2006 J. B. Wallace (jbwallace@shaw.ca) 2006.7.22

INTEGRATION WITH XML
Copyright (c) 2006 K. B. Gervais (kevinalwayswins@hotmail.com) 2006.8.25
Adaption copyright CyKron Interactive (www.cykron.com).

Canpar MVS (Multi Vendor Shipping) ADAPTATION
Copyright (c) 2007 S.A Aderogba (saderogba@gmail.com) 2007.12.13
Online Store Support (www.aderogba.com).

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

class canpar {
var $code, $title, $description, $icon, $enabled;
// class constructor
function canpar($method = '', $module = '', $vendors_id = '1') {
global $order; /*, $vendors_id;*/

$this->code = 'canpar';
$this->title = MODULE_SHIPPING_CANPAR_TEXT_TITLE;
$this->description = MODULE_SHIPPING_CANPAR_TEXT_DESCRIPTION;
//$this->mark_up = (int)constant('MODULE_SHIPPING_CANPAR_MARK_UP_'.$vendors_id);

//$this->mark_up = (int)$this->mark_up;

//$this->sort_order = MODULE_SHIPPING_CANPAR_SORT_ORDER;
$this->icon = DIR_WS_ICONS . 'canpar.gif';
//$this->tax_class = MODULE_SHIPPING_CANPAR_TAX_CLASS;
//$this->enabled = ((MODULE_SHIPPING_CANPAR_STATUS == 'True') ? true : false);

$this->delivery_country_id = $order->delivery['country']['id'];
$this->delivery_zone_id = $order->delivery['zone_id'];
$this->types = array(’GND’ => ‘Canada Ground’,
‘USA’ => ‘US Ground’,
‘SLET’ => ‘Select Letter’,
‘SPAK’ => ‘Select Pak’,
‘SPAR’ => ‘Select Parcel’);

}
///MVS Start

function sort_order($vendors_id=’1′) {
if (defined (@constant (’MODULE_SHIPPING_CANPAR_SORT_ORDER’ . $vendors_id))) {
$this->sort_order = @constant(’MODULE_SHIPPING_CANPAR_SORT_ORDER’ . $vendors_id);
} else {
$this->sort_order = ‘0′;
}
return $this->sort_order;
}

function tax_class($vendors_id=’1′) {
$this->tax_class = @constant(’MODULE_SHIPPING_CANPAR_TAX_CLASS_’ . $vendors_id);
return $this->tax_class;
}

function enabled($vendors_id=’1′) {
$this->enabled = false;
$status = @constant(’MODULE_SHIPPING_CANPAR_STATUS_’ . $vendors_id);
if (isset ($status) && $status != ”) {
$this->enabled = (($status == ‘True’) ? true : false);
}
return $this->enabled;
}

function zones($vendors_id=’1′) {
if ( ($this->enabled == true) && ((int)constant(’MODULE_SHIPPING_CANPAR_ZONE_’ . $vendors_id) > 0) ) {
$check_flag = false;
$check_query = tep_db_query(”select zone_id from ” . TABLE_ZONES_TO_GEO_ZONES . ” where geo_zone_id = ‘” . (int)constant(’MODULE_SHIPPING_CANPAR_ZONE_’ . $vendors_id) . “‘ and zone_country_id = ‘” . $order->delivery['country']['id'] . “‘ order by zone_id”);
while ($check = tep_db_fetch_array($check_query)) {
if ($check['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
} //if
}//while

if ($check_flag == false) {
$this->enabled = false;
}//if
}//if
return $this->enabled;
}

///

// class methods
function quote($method = ”, $module=”, $vendors_id=’1′) {
global $order, $shipping_weight,$shipping_num_boxes, $cart;

$srcFSA = substr(strtoupper(SHIPPING_ORIGIN_ZIP), 0, 3);
$desFSA = substr(strtoupper($order->delivery['postcode']), 0, 3);

$srcFSA1stLetter = substr(strtoupper(SHIPPING_ORIGIN_ZIP), 0, 1);
$desFSA1stLetter = substr(strtoupper($order->delivery['postcode']), 0, 1);

//$PkgWT = $shipping_weight;

// start of modification to get weight for this vendor only instead of using total cart weight
$PkgWT=0;
$products_array = $cart->get_products();

//print_r($products_array);

$xc_count=0;
for($ii=0; $ii
{
if($products_array[$ii]['vendors_id'] == $vendors_id)
{
$PkgWT = $PkgWT + $products_array[$ii]['weight']*$products_array[$ii]['quantity'];
$xc_count = $xc_count + 1;
}

}

// end

/*
//Connect to CanPar here to get quote, and parse XML.
$request = join(’&’, array(’service=1′,
‘quantity=’ . $shipping_num_boxes,
‘unit=L’,
‘origin=’ . $srcFSA,
‘dest=’ . $desFSA,
‘cod=0′,
‘weight=’ . intval($shipping_weight),
‘put=0′,
‘xc=0′,
‘dec=0′));

$http = new httpClient();

if ($http->Connect(’www.canpar.com’, 80)) {
$http->addHeader(’Host’, ‘www.canpar.com’);
$http->addHeader(’User-Agent’, ‘osCommerce’);
$http->addHeader(’Connection’, ‘Close’);

if ($http->Get(’/CanparRateXML/BaseRateXML.jsp?’ . $request)) $body = $http->getBody();

$http->Disconnect();
} else {
return ‘error’;
}

$body_array = explode(”", $body);
$ShippingCost = $body_array[1];
$ShippingCost = ereg_replace(”, ”, $ShippingCost);
*/

$this->quotes = array(’id’ => $this->code,
‘module’ => $this->title . ‘ (’ . $xc_count . ‘ x ‘ . $PkgWT . ‘lbs)’);
//MVS ADD
$vendors_data_query = tep_db_query(”select handling_charge, handling_per_box, vendor_country
from ” . TABLE_VENDORS . ”
where vendors_id = ‘” . (int)$vendors_id . “‘”
);
$vendors_data = tep_db_fetch_array($vendors_data_query);
$country_name = tep_get_countries($vendors_data['vendor_country'], true);

$handling_charge = $vendors_data['handling_charge'];
$handling_per_box = $vendors_data['handling_per_box'];
if ($handling_charge > $handling_per_box*$xc_count) {
$handling = $handling_charge;
} else {
$handling = $handling_per_box*$xc_count;
}
//MVS END

// Begin Connect Method Patch
$methods = array();
$allowed_methods = explode(”, “, @constant (’MODULE_SHIPPING_CANPAR_TYPES_’ . $vendors_id));

$temp_arr =array();
if($order->delivery['country']['iso_code_3'] == ‘USA’) //if delivery is USA, remove all non-USA methods
{
for($ii=0; $ii
{
if($allowed_methods[$ii] != ‘USA’)continue;
else $temp_arr[] = $allowed_methods[$ii];
}

}
else
{
$temp_arr =array();
if($order->delivery['country']['iso_code_3'] != ‘USA’)
{
for($ii=0; $ii
{
if($allowed_methods[$ii] == ‘USA’)continue;
else $temp_arr[] = $allowed_methods[$ii];
}
}
}

unset($allowed_methods);
$allowed_methods=$temp_arr;

$mark_up = (int)constant(’MODULE_SHIPPING_CANPAR_MARK_UP_’.$vendors_id);

for($ii=0; $ii
if($allowed_methods[$ii]==’GND’)$sel_ser=’1′;
if($allowed_methods[$ii]==’USA’)$sel_ser=’2′;
if($allowed_methods[$ii]==’SLET’)$sel_ser=’3′;
if($allowed_methods[$ii]==’SPAK’)$sel_ser=’4′;
if($allowed_methods[$ii]==’SPAR’)$sel_ser=’5′;
$request = join(’&’, array(’service=’.$sel_ser,
‘quantity=’ . $xc_count,
‘unit=L’,
‘origin=’ . $srcFSA,
‘dest=’ . $desFSA,
‘cod=0′,
‘weight=’ . intval($PkgWT),
‘put=0′,
‘xc=0′,
‘dec=0′));

$body = file_get_contents(’http://www.canpar.com/CanparRateXML/BaseRateXML.jsp?’ . $request);
$body_array = explode(”", $body);

$ShippingCost = $body_array[1];
$ShippingCost = ereg_replace(”, ”, $ShippingCost);
$methods[] = array(’id’ => $allowed_methods[$ii],
‘title’ => $this->types[$allowed_methods[$ii]],
‘cost’ => ($ShippingCost * $shipping_num_boxes) + $handling + $mark_up);

}

//print_r($methods);

// End Connect Method Patch

if (strlen($ErrMsg) == 0) {
//$this->quotes = array(’id’ => $this->code,
// ‘module’ => MODULE_SHIPPING_CANPAR_TEXT_TITLE,
// ‘methods’ => array(array(’id’ => $this->code,
// ‘title’ => MODULE_SHIPPING_CANPAR_TEXT_WAY,
// ‘cost’ => $ShippingCost + $handling + $this->mark_up)));
$this->quotes['methods'] = $methods;
} else {
$this->quotes = array(’module’ => $this->title,
‘error’ => $ErrMsg);
}

if ($this->tax_class($vendors_id) > 0) {
$this->quotes['tax'] = tep_get_tax_rate($this->tax_class($vendors_id), $order->delivery['country']['id'], $order->delivery['zone_id']);
}

if (tep_not_null($this->icon)) $this->quotes['icon'] = ‘
‘ . tep_image($this->icon, $this->title);

return $this->quotes;
}

function check($vendors_id=’1′) {
if (!isset($this->_check)) {
$check_query = tep_db_query(”select configuration_value from ” . TABLE_VENDOR_CONFIGURATION . ” where vendors_id = ‘”. $vendors_id .”‘ and configuration_key = ‘MODULE_SHIPPING_CANPAR_STATUS_” . $vendors_id . “‘”);
$this->_check = tep_db_num_rows($check_query);
}
return $this->_check;
}
function install($vendors_id=’1′) {
tep_db_query(”insert into ” . TABLE_VENDOR_CONFIGURATION . ” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, vendors_id) values (’Enable CANPAR Shipping’, ‘MODULE_SHIPPING_CANPAR_STATUS_” . $vendors_id . “‘, ‘True’, ‘Do you want to offer CANPAR rate shipping?’, ‘6′, ‘0′, ‘tep_cfg_select_option(array(\’True\’, \’False\’), ‘, now(), ‘” . $vendors_id . “‘)”);
tep_db_query(”insert into ” . TABLE_VENDOR_CONFIGURATION . ” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added, vendors_id) values (’Tax Class’, ‘MODULE_SHIPPING_CANPAR_TAX_CLASS_” . $vendors_id . “‘, ‘0′, ‘Use the following tax class on the shipping fee.’, ‘6′, ‘0′, ‘tep_get_tax_class_title’, ‘tep_cfg_pull_down_tax_classes(’, now(), ‘” . $vendors_id . “‘)”);
tep_db_query(”insert into ” . TABLE_VENDOR_CONFIGURATION . ” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values (’Mark Up’, ‘MODULE_SHIPPING_CANPAR_MARK_UP_” . $vendors_id . “‘, ‘1′, ‘Use the following mark-up on the shipping list fees.’, ‘6′, ‘0′, now(), ‘” . $vendors_id . “‘)”);
tep_db_query(”insert into ” . TABLE_VENDOR_CONFIGURATION . ” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values (’Sort Order’, ‘MODULE_SHIPPING_CANPAR_SORT_ORDER_” . $vendors_id . “‘, ‘0′, ‘Sort order of display.’, ‘6′, ‘0′, now(), ‘” . $vendors_id . “‘)”);
tep_db_query(”insert into ” . TABLE_VENDOR_CONFIGURATION . ” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added, vendors_id) values (’Shipping Zone’, ‘MODULE_SHIPPING_CANPAR_ZONE_” . $vendors_id . “‘, ‘0′, ‘If a zone is selected, only enable this shipping method for that zone.’, ‘6′, ‘0′, ‘tep_get_zone_class_title’, ‘tep_cfg_pull_down_zone_classes(’, now(), ‘” . $vendors_id . “‘)”);
tep_db_query(”insert into ” . TABLE_VENDOR_CONFIGURATION . ” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, vendors_id) values (’Shipping Methods’, ‘MODULE_SHIPPING_CANPAR_TYPES_” . $vendors_id . “‘, ‘GND, USA, SLET, SPAK, SPAR’, ‘Select the CANPAR services to be offered.’, ‘6′, ‘0′, ‘tep_cfg_select_multioption(array(\’GND\’,\’USA\’, \’SLET\’, \’SPAK\’, \’SPAR\’), ‘, now(), ‘” . $vendors_id . “‘)”);

}
function remove($vendors_id=’1′) {
tep_db_query(”delete from ” . TABLE_VENDOR_CONFIGURATION . ” where vendors_id = ‘”.$vendors_id.”‘ and configuration_key in (’” . implode(”‘, ‘”, $this->keys($vendors_id)) . “‘)”);
}

function keys($vendors_id=’1′) {
return array(’MODULE_SHIPPING_CANPAR_STATUS_’.$vendors_id, ‘MODULE_SHIPPING_CANPAR_TAX_CLASS_’.$vendors_id, ‘MODULE_SHIPPING_CANPAR_MARK_UP_’.$vendors_id, ‘MODULE_SHIPPING_CANPAR_SORT_ORDER_’.$vendors_id, ‘MODULE_SHIPPING_CANPAR_ZONE_’ . $vendors_id, ‘MODULE_SHIPPING_CANPAR_TYPES_’ . $vendors_id);
}
}
?>

Enjoy! Contact me if you have problem using it.

These tools/software are very important for any on-line stores:

Goolge Analytics
Goolge Webmastertool
Google Product Search (and other products search engines)
SEO url

They should be implemented as soon as feasible.

I have noticed that there are instances where the table rate shipping module gives the wrong shipping quote. This situation applies to the standard table rate and the modified table rate for the Mutli-Vendor Shipping. It also applies to both the price and the weight table methods. What I have done is to modify the code in the qoute function as shown here, this example is for a Mutli-Vendor Shipping store.

$table103_cost = split("[:,]” , @constant(’MODULE_SHIPPING_TABLE103_COST_’ . $vendors_id));
$size = sizeof($table103_cost);
for ($i=0, $n=$size; $i<$n; $i+=2) {
if($i==0)if($order_total <= $table103_cost[$i])$shipping = $table103_cost[$i+1];
if($i>0)if($order_total > $table103_cost[$i-2] && $order_total <= $table103_cost[$i])$shipping = $table103_cost[$i+1];
if($i==$n-2)if($order_total > $table103_cost[$i])$shipping = $table103_cost[$i+1];
}

$table103_cost and ‘MODULE_SHIPPING_TABLE103_COST_’ are variable names so before you do anything backup your file and change them to the corresponding name in your file.

If you are concern about make these changes youselft, contact me.

Dec 13 2007

URLs Restricted by robots.txt

solution | SEO | 0 Comments

I get questions on why Google Webmaster Tool shows numerous links as restricted. The reason for this may due to information in your robots.txt file and/or information in your sitemap. If you have both, it’s a good idea to check the restricted links against robots.txt and sitemap file. Overall the best way to troubleshoot this problem is to follow Google’s guideline:

Debugging blocked URLs

From my experience many of these restricted links are valid; good examples are buy now and product review links. It’s obvious that a search engine robot will neither be able to make a purchase or write a product review. For the case of buy now; in product_listing.php, you can wrap the code in an if statement like so:

case 'PRODUCT_LIST_BUY_NOW':
$lc_align = 'center';
if($session_started) $lc_text = ‘…’;
else $lc_text = ”;
break;

While looking for information on how to submit sitemap to MSN, I can across this piece of information from Yahoo blog. To add sitemap to robots.txt, just add the following line:

Sitemap: http://www.example.com/sitemap.xml

In case you have multiple Sitemaps, you can point to your sitemap index
Sitemap: http://www.example.com/sitemapindex.xml

To do this, simply add the following line to your robots.txt file:

Sitemap: http://www.example.com/sitemap.xml

Please provide the complete URL for your Sitemap on this line. We will pick it up wherever you put it in your robots.txt file. This directive is not specific to user-agent. If you have multiple Sitemaps, you can point to your Sitemap index file on this line.

It is good to know that one does need to manually submit site map to Google, Yahoo and MSN. I hope this is going to be the standard very soon.

It is important to know that CRE Loaded EPB is in many respect similar to osC Easy Populate. In EPB product uniqueness is based on ‘product model.’ If you are using osCommerce, the only option you have is pretty much the Easy Populate, this is the contribution you have to install. On the other hand if you are using CRE Loaded, you have to wander at some point which one you have to use. This is what I recommend:
* if products on your site are going to be the same over time then go for EPA
* if products on your site are going to be different from time to time, then go for EPB
* if you are using data feed with schedule tasks to load your products them EPB will be a good option to consider
* there may be situations where things have to be done differently, I encouraged store administrators to think about this before investing too much time on a particular EP.
* Lastly if you are using or going to use SEO URL, you need to factor this into your considerations at the beginning, you don’t want to lose all those pages that search engines have indexed for your site. Talking about SEO URL, Ultimate SEO URLs, is a good one to use because it works well with the google xml site map generator.

For many online store administrator, there is a need to add “Shipped” to the standard list of order status. This is because non of the default order status correctly tells customers that their order has been shipped. See complete default list in admin by going to Customers/orders -> Orders -> Edit Status.

Here are steps for adding a new order status value to the order status pull down menu. The same process can be used to add additional values to order status at any time.

1. Open your database in phpMyAdmin; select `orders_status`
2. Run this command:

INSERT INTO `orders_status` (`orders_status_id`, `language_id`, `orders_status_name`) VALUES (’222′, ‘1′, ‘Shipped’);

3. In case you need to add additional values, increment order_status_id to something like 223. Also language_id used here is for ‘english’, to get the correct language_id for your installation, I suggest you check the values in your admin by going to localization -> languages.