Products     Magento Extension     PCI-Shopping-Carts     Templates       CRELoaded     WordPress Modules     osCommerce Modules       osCommerce Addons       osCommerce Features       osCommerce Management       Payment Modules     CRELoaded Modules       CRE Loaded Addons       CRE Loaded Features       CRE Loaded Management       Payment Modules       CRELoaded Services
Free Stuff
Customization
Templates
Compare Products
You have no items to compare.
Affiliate Info
Affiliate Program FAQ
Affiliate Log In
Recent Orders
Hot Keywords: Order Notification, Order Search, Coupon, Flash Board, Compare, Floating Message, Tracking, Moneris, RSS, Visitor Filter

  Individual Product Shipping Prices - v1.0

The following osCommerce contribution is a free Opensource code originated from official osCommerce website and provided for your reference only, you may download the original contribution file(s) and install it on your own; or you may request a Paid Installation Service from Agents Of Power; Agents Of Power does the "AS IS" installation on your website, we do not guarantee it will work properly on your website. Extra Paid service is available for repairing the problem from the original contribution or from your website.
Previous version did not download the complete product to xcel, only product that has indv price was set.

This is a complete updated instruction which will export all products including the one that does not have the shipping price set...
This package is for those who use easy populate w/ attribute contribution to import and export products into excel.

This have added two field, products_ship_price and products_ship_price_two.

What's not included:
method_id, and zip code...

Tested and work with OSC,R2a
Hi All,

This is same as file below, except this one will work if you have the ajax order editor installed http://addons.oscommerce.com/info/1435


Steve
Hi i manged to combine http://addons.oscommerce.com/info/5965 with Individual Shipping you can now have a surcharge on say states like Hawaii and Alaska.

This adds 2 new fields in admin, where you enter the states and the surcharge.

simply upload file to catalog/includes/modules/shipping folder thats it,

Remember to remove Individual Shipping module before you upload it then install it after upload
Failure to do above wll result in it not working for state surcharge

All credits to Authors of both contributions
When I was trying to use it I got some error such as other shipping options were not shown/worked and there was no option to integrate it with Onepage checkout addons (http://addons.oscommerce.com/info/6646).

I have changed two files in classes directory.

1. shipping.php
2. onepage_checkout.php (you have to add this file if you use onepage checkout contribution).

Other files are remaining same for both of the addons.

2 files uploaded.
Paypal Standard won't take the total to paypal portal.

open: catalogincludesmodulespaymentpaypal_standard.php

find:
function process_button() {

below you should see:
global $customer_id, $order, $sendto, $currency, $cart_PayPal_Standard_ID, $shipping;

if you only see: global $customer_id, $order, $sendto, $currency, $cart_PayPal_Standard_ID;

then replace $cart_PayPal_Standard_ID; with $cart_PayPal_Standard_ID, $shipping;

find:
'shipping' => $this->format_raw($order->info['shipping_cost']),

change to:
'shipping' => $this->format_raw($shiptotal),

find:
'amount' => $this->format_raw($order->info['total'] - $order->info['shipping_cost'] - $order->info['tax']),

replace it with:
'amount' => $this->format_raw($order->info['total'] - $shiptotal - $order->info['tax']),
I found that it is inconvient to use tep_not null becuase if you removed the amount and there still be a 0 left where it still notnull. so.

simple changed from:

if (tep_not_null($shiptotal) || tep_not_null($indvcount) || $shiptotal == '0'){

to:

if ($shiptotal != '0'){


so if $shiptotal is not equal to 0, meaning if there is an amount, it will show Shipping Total, then if shiptotal is 0, then it will show Free Shipping.

Previous version cannot apply to this case.

Please change if you have better idea....

included complete addon....

Through support thread, reported won't show all shipping option...

found the following block in catalog/includes/classes/shipping.php

// start indvship
//while (list(, $value) = each($this->modules)) {
// $class = substr($value, 0, strrpos($value, '.'));
// $include_modules[] = array('class' => $class, 'file' => $value);
//}
//}

if($indvcount==sizeof($products)){
if ((tep_get_configuration_key_value('MODULE_SHIPPING_INDVSHIP_STATUS')) && ((tep_not_null($shiptotal)) || $shiptotal == 0)) {
$include_modules[] = array('class'=> 'indvship', 'file' => 'indvship.php');
}
} else {
if(sizeof($products)>$indvcount){
while (list(, $value) = each($this->modules)) {
$class = substr($value, 0, strrpos($value, '.'));
if (($class !='freeshipper') && ($class != 'indvship')) { // comment to show all ship options
// if ($class !='freeshipper') { // uncomment to show all ship options
$include_modules[] = array('class' => $class, 'file' => $value);
}
}
}
}
}
// end indvship


where you can uncomment and comment the line:
if (($class !='freeshipper') && ($class != 'indvship')) { // comment to show all ship options
// if ($class !='freeshipper') { // uncomment to show all ship options

to show all shipping option, however, it doesn't work, so i remove that whole block seems like it doesn't needed to be there. and it shows all shipping option.


see below is the complete shipping.php for catalog/includes/classes/shipping.php

if anyone can find a better fix, please added to this...

you can compare for which part to modify!

<?php
/*
$Id: shipping.php,v 1.23 2003/06/29 11:22:05 hpdl Exp $

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

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

class shipping {
var $modules;

// class constructor
function shipping($module = '') {

// start indvship
// global $language, $PHP_SELF;
global $language, $PHP_SELF, $cart;
// New to fix attributes bug
$cart_products = $cart->get_products();
if (tep_not_null($cart_products)) {
$real_ids = array();
foreach($cart_products as $prod){
$real_ids[] = tep_get_prid($prod['id']);
}
$sql = "SELECT products_ship_methods_id FROM ".TABLE_PRODUCTS_SHIPPING." WHERE products_id IN (".implode(',',$real_ids).") AND products_ship_methods_id IS NOT NULL AND products_ship_methods_id <> ''";
$query = mysql_query($sql);
// End new bug fix
$allow_mod_array = array();
while($rec = mysql_fetch_array($query)){
if(empty($allow_mod_array)) $startedempty = true;
$methods_array = array();
$methods_array = explode(';',$rec['products_ship_methods_id']);
if(!empty($methods_array)){
foreach($methods_array as $method){
$allow_mod_array[] = $method;
}
}
if($startedempty){
$startedempty = false;
}else{
$temp_array = array();
foreach($allow_mod_array as $val){
$temp_array[$val]++;
}
$allow_mod_array = array();
foreach($temp_array as $key => $val){
if($val > 1){
$allow_mod_array[] = $key;
}
}
}
}
}
// INDIV_SM END
if (defined('MODULE_SHIPPING_INSTALLED') && tep_not_null(MODULE_SHIPPING_INSTALLED)) {
$this->modules = explode(';', MODULE_SHIPPING_INSTALLED);
// INDIV_SM START
if (tep_not_null($cart_products)) {
$temp_array = $this->modules;
$this->modules = array();
foreach($temp_array as $val){
if(mysql_num_rows($query)==0 || in_array(str_replace('.php','',$val),$allow_mod_array)) {
$this->modules[] = $val;
}
}
}
// INDIV_SM END
$include_modules = array();

if ( (tep_not_null($module)) && (in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $this->modules)) ) {
$include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')), 'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)));
} else {
reset($this->modules);
//// original block >>>>
while (list(, $value) = each($this->modules)) {
$class = substr($value, 0, strrpos($value, '.'));
$include_modules[] = array('class' => $class, 'file' => $value);
}
}
//// end original block <<<<
/* >>>> below where it doesn't show all option, and doesn't seem nessecarily needed <<<<<<<<<<<
// start indvship
//while (list(, $value) = each($this->modules)) {
// $class = substr($value, 0, strrpos($value, '.'));
// $include_modules[] = array('class' => $class, 'file' => $value);
//}
//}

if($indvcount==sizeof($products)){
if ((tep_get_configuration_key_value('MODULE_SHIPPING_INDVSHIP_STATUS')) && ((tep_not_null($shiptotal)) || $shiptotal == 0)) {
$include_modules[] = array('class'=> 'indvship', 'file' => 'indvship.php');
}
} else {
if(sizeof($products)>$indvcount){
while (list(, $value) = each($this->modules)) {
$class = substr($value, 0, strrpos($value, '.'));
if (($class !='freeshipper') && ($class != 'indvship')) { // comment to show all ship options
// if ($class !='freeshipper') { // uncomment to show all ship options
$include_modules[] = array('class' => $class, 'file' => $value);
}
}
}
}
}
// end indvship
*/
for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) {
include(DIR_WS_LANGUAGES . $language . '/modules/shipping/' . $include_modules[$i]['file']);
include(DIR_WS_MODULES . 'shipping/' . $include_modules[$i]['file']);

$GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class'];
}
}
}

function quote($method = '', $module = '') {
global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;

$quotes_array = array();

if (is_array($this->modules)) {
$shipping_quoted = '';
$shipping_num_boxes = 1;
$shipping_weight = $total_weight;

if (SHIPPING_BOX_WEIGHT >= $shipping_weight*SHIPPING_BOX_PADDING/100) {
$shipping_weight = $shipping_weight+SHIPPING_BOX_WEIGHT;
} else {
$shipping_weight = $shipping_weight + ($shipping_weight*SHIPPING_BOX_PADDING/100);
}

if ($shipping_weight > SHIPPING_MAX_WEIGHT) { // Split into many boxes
$shipping_num_boxes = ceil($shipping_weight/SHIPPING_MAX_WEIGHT);
$shipping_weight = $shipping_weight/$shipping_num_boxes;
}

$include_quotes = array();

reset($this->modules);
while (list(, $value) = each($this->modules)) {
$class = substr($value, 0, strrpos($value, '.'));
if (tep_not_null($module)) {
if ( ($module == $class) && ($GLOBALS[$class]->enabled) ) {
$include_quotes[] = $class;
}
} elseif ($GLOBALS[$class]->enabled) {
$include_quotes[] = $class;
}
}

$size = sizeof($include_quotes);
for ($i=0; $i<$size; $i++) {
$quotes = $GLOBALS[$include_quotes[$i]]->quote($method);
if (is_array($quotes)) $quotes_array[] = $quotes;
}
}

return $quotes_array;
}

//start indvship
function get_shiptotal() {
global $cart, $order;
$this->shiptotal = '';
$products = $cart->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
if (tep_not_null($products[$i]['products_ship_price'])) {
$products_ship_price = $products[$i]['products_ship_price'];
$products_ship_price_two = $products[$i]['products_ship_price_two'];
$products_ship_zip = $products[$i]['products_ship_zip'];
$qty = $products[$i]['quantity'];
if(tep_not_null($products_ship_price) ||tep_not_null($products_ship_price_two)){
$this->shiptotal += ($products_ship_price);
if ($qty > 1) {
if (tep_not_null($products_ship_price_two)) {
$this->shiptotal += ($products_ship_price_two * ($qty-1));
} else {
$this->shiptotal += ($products_ship_price * ($qty-1));
}
}/////////////NOT HERE <<------------
}
}
}// CHECK TO SEE IF SHIPPING TO HOME COUNTRY, IF NOT INCREASE SHIPPING COSTS BY AMOUNT SET IN ADMIN/////////////move back here <<------------
if (($order->delivery['country']['id']) != INDIVIDUAL_SHIP_HOME_COUNTRY) {
if(INDIVIDUAL_SHIP_INCREASE > '0' || $this->shiptotal > '0') {
$this->shiptotal *= INDIVIDUAL_SHIP_INCREASE;
} else {
$this->shiptotal += INDIVIDUAL_SHIP_INCREASE * $this->get_indvcount();
}
return $this->shiptotal;
// not sure why this is needed, but it now works correctly for home country - by Ed
} else {
$this->shiptotal *= 1;
return $this->shiptotal;
}
}

function get_indvcount() {
global $cart;
$this->indvcount = '';
$products = $cart->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
if (tep_not_null($products[$i]['products_ship_price'])) {
$products_ship_price = $products[$i]['products_ship_price'];//}
$products_ship_price_two = $products[$i]['products_ship_price_two'];
if(is_numeric($products_ship_price)){
$this->indvcount += '1';
}
}
}
return $this->indvcount;
}

// end indvship

function cheapest() {
if (is_array($this->modules)) {
$rates = array();

reset($this->modules);
while (list(, $value) = each($this->modules)) {
$class = substr($value, 0, strrpos($value, '.'));
if ($GLOBALS[$class]->enabled) {
$quotes = $GLOBALS[$class]->quotes;
for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) {
if (isset($quotes['methods'][$i]['cost']) && tep_not_null($quotes['methods'][$i]['cost'])) {
$rates[] = array('id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'],
'title' => $quotes['module'] . ' (' . $quotes['methods'][$i]['title'] . ')',
'cost' => $quotes['methods'][$i]['cost']);
}
}
}
}

$cheapest = false;
for ($i=0, $n=sizeof($rates); $i<$n; $i++) {
if (is_array($cheapest)) {
if ($rates[$i]['cost'] < $cheapest['cost']) {
$cheapest = $rates[$i];
}
} else {
$cheapest = $rates[$i];
}
}

return $cheapest;
}
}
}
?>



Important, this is not a complete package, only fix!
sorry, i messed up alittle bit at the product listing sql query, for product listing,

Erase this if you already install:
$product_query = tep_db_query("select products_description, shipping_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$listing['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
$product = tep_db_fetch_array($product_query);
$new_products['products_description, shipping_description'] = $product['products_description, shipping_description'];


Find or replace the above with this:
$product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$listing['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
$product = tep_db_fetch_array($product_query);
$new_products['products_description'] = $product['products_description'];

and add this below:
$product_query = tep_db_query("select shipping_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$listing['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
$product = tep_db_fetch_array($product_query);
$shipping_description['shipping_description'] = $product['shipping_description'];


then use this: instead of the one in the instruction.

<!-- this block of code -->
<tr><td>
';
if(tep_not_null($shipping_description['shipping_description'])) echo '&#149;'; else echo '&#149; Carrier information is not available.'; echo $shipping_description['shipping_description'];

echo '
</td></tr>
<!-- this block of code -->

   Posted on: 02/22/2009     See contribution details Request Installation with Paid service