Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] individual product shipping prices


Recommended Posts

Hello,

 

I have got this contrib working ok except when you hit the checkout confirmation page it will not display. The rest of the time it works fine. Any ideas on why the order confirmation page won't display?

 

Thanks in advance!

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Link to comment
Share on other sites

Hello,

 

I have got this contrib working ok except when you hit the checkout confirmation page it will not display. The rest of the time it works fine. Any ideas on why the order confirmation page won't display?

 

Thanks in advance!

 

Figured it out I just misunderstood the directions!

7- catalog/checkout_confirmation.php

8- catalog/checkout_process.php --new

9- catalog/checkout_paypalipn.php --new

 

all need to have the

require(DIR_WS_CLASSES . 'shipping.php');

$shipping_modules = new shipping($shipping);

 

commented out NOT just check_paypalipn.php

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Link to comment
Share on other sites

I'm having another problem still, I can make other shipping modules display if I take out the Shipping Zone in the shipping modules but as soon as I add the shipping zone back in it does not show up on the list of choices. I removed this entire contribution just to test and there they were, readded the contribution and I cannot see the choices again. I tried the fix way back on post 150 http://www.oscommerce.com/forums/index.php?sho...ndpost&p=532515 but it doesn't work.

 

I'm sure others have encountered this, how do you fix it?

 

Thanks!

Edited by homewetbar

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Link to comment
Share on other sites

Followed the instructions to a T. Had one more error and made the modifications. I can't figure this one out though..

 

Can someone help me.

 

Fatal error: Cannot redeclare class shipping in c:\web\easyphp1-7\www\catalog\includes\classes\shipping.php on line 13

 

Thank you kindly in advance.

 

Keith

Link to comment
Share on other sites

I'm banging my head against the wall, I've gone over and over the code line by line but I cannot figure this out still!!! >_<

It will not display shipping modules with a zone set, how can I fix this? Anyone please????

Edited by homewetbar

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Link to comment
Share on other sites

I'm having another problem still, I can make other shipping modules display if I take out the Shipping Zone in the shipping modules but as soon as I add the shipping zone back in it does not show up on the list of choices. I removed this entire contribution just to test and there they were, readded the contribution and I cannot see the choices again. I tried the fix way back on post 150 http://www.oscommerce.com/forums/index.php?sho...ndpost&p=532515 but it doesn't work.

 

I'm sure others have encountered this, how do you fix it?

 

Thanks!

Hi All,

 

I seem to have this module working but I can not get it to be listed on the order confirmation pages and also I can not get any other modules listed on these pages. It simply adds the amount it should for indvid prices to the total - but still no listing of shipping details. Appears a similar problem to the one above, does anyone have any ideas. I have pasted the main code from shipping.php below:

 

<?php

/*

$Id: shipping.php,v 1.3 2003/09/30 16:32:45 serg Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

 

class shipping {

var $modules;

 

// class constructor

function shipping($module = '') {

global $language, $PHP_SELF, $cart;

// BOF: Individual Shipping Prices//phpmom.com

$products = $cart->get_products();

 

$shiptotal = $this->get_shiptotal();

$indvcount = $this->get_indvcount();

// EOF: Individual Shipping Prices

if (defined('MODULE_SHIPPING_INSTALLED') && tep_not_null(MODULE_SHIPPING_INSTALLED)) {

$this->modules = explode(';', MODULE_SHIPPING_INSTALLED);

 

$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);

// BOF: Individual Shipping Prices//phpmom.com

// Show either normal shipping modules or Individual shipping module when Individual Shipping Module is On

// Show Individual Shipping Only

if($indvcount==sizeof($products)){ //hadir

if ((tep_get_configuration_key_value('MODULE_SHIPPING_INDVSHIP_STATUS')) && $shiptotal) {

$include_modules[] = array('class'=> 'indvship', 'file' => 'indvship.php');

}}

// BOF: WebMakers.com Added: Downloads Controller - Free Shipping and Payments

// Show either normal shipping modules or free shipping module when Free Shipping Module is On

// Free Shipping Only

if ((tep_get_configuration_key_value('MODULE_SHIPPING_FREESHIPPER_STATUS')) && $cart->show_weight()==0 && ($shiptotal == '0' || !$shiptotal)) {

$include_modules[] = array('class'=> 'freeshipper', 'file' => 'freeshipper.php');

} else {

// All Other Shipping Modules

if(sizeof($products)>$indvcount){

while (list(, $value) = each($this->modules)) { //try foreach is faster//hadir

$class = substr($value, 0, strrpos($value, '.'));

// Don't show Free Shipping Module

if (($class !='freeshipper')/* && ($class != 'indvship')*/) {

$include_modules[] = array('class' => $class, 'file' => $value);

}

}

}}

// EOF: Free Shipping and Payments// EOF: Individual Shipping Prices

}

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;

}

//phpmom.com// find shiptotoal and indvcount(# of products with indv shipping//

function get_shiptotal() {

global $cart;

$this->shiptotal = '';

$products = $cart->get_products();

for ($i=0, $n=sizeof($products); $i<$n; $i++) {

// mod indvship//modified hadir

// if ($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(($products_ship_price) ||($products_ship_price_two)){

$this->shiptotal += ($products_ship_price);

if ($qty > 1) {

if ($products_ship_price_two) {

$this->shiptotal += ($products_ship_price_two * ($qty-1));

} else {

$this->shiptotal += ($products_ship_price * ($qty-1));

}

} }

} // first mod ok $this->shiptotal += ($products_ship_price * $qty);

// mod indvship//modified hadir

// first mod ok $this->shiptotal += ($products_ship_price * $qty);

// end indvship

return $this->shiptotal;

}

 

function get_indvcount() {

global $cart;

$this->indvcount = '';

$products = $cart->get_products();

for ($i=0, $n=sizeof($products); $i<$n; $i++) {

// mod indvship//modified hadir

// if ($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';

}

} // first mod ok $this->shiptotal += ($products_ship_price * $qty);

// mod indvship//modified hadir

// first mod ok $this->shiptotal += ($products_ship_price * $qty);

// end indvship

return $this->indvcount;

} //end phpmom.com

 

 

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;

}

}

}

?>

 

 

 

Many Thanks!!!!

Link to comment
Share on other sites

Hi. I am encountering the following error when attempting to Checkout with my goods:

Fatal error: Cannot redeclare class indvship in /home/movingtone/public_html/shop/includes/modules/shipping/indvship.php on line 14

 

I know a problem like this has been mentioned way earlier in this thread, but I have tried to follow the advice/solutions given there without success. I imagine that I have declared 'indvship' twice at some point, but am not skilled enough to determine where - I guess in the classes/shipping.php file somewhere? I'm reproducing that file below in case it is of any use, and I would be most grateful for some help as the rest of the mod seems to be working fine.

 

<?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 = '') {
     global $language, $PHP_SELF, $cart;
// BOF: Individual Shipping Prices//phpmom.com
$products = $cart->get_products();

$shiptotal = $this->get_shiptotal();
$indvcount = $this->get_indvcount();
// EOF: Individual Shipping Prices


     if (defined('MODULE_SHIPPING_INSTALLED') && tep_not_null(MODULE_SHIPPING_INSTALLED)) {
       $this->modules = explode(';', MODULE_SHIPPING_INSTALLED);

       $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);
        // BOF: Individual Shipping Prices//phpmom.com
// Show either normal shipping modules or Individual shipping module when Individual Shipping Module is On
// Show Individual Shipping Only
if($indvcount==sizeof($products)){ //hadir
if ((tep_get_configuration_key_value('MODULE_SHIPPING_INDVSHIP_STATUS')) && $shiptotal) {
$include_modules[] = array('class'=> 'indvship', 'file' => 'indvship.php');
}}
// BOF: WebMakers.com Added: Downloads Controller - Free Shipping and Payments
// Show either normal shipping modules or free shipping module when Free Shipping Module is On
// Free Shipping Only
if ((tep_get_configuration_key_value('MODULE_SHIPPING_FREESHIPPER_STATUS')) && $cart->show_weight()==0 && ($shiptotal == '0' || !$shiptotal)) {
$include_modules[] = array('class'=> 'freeshipper', 'file' => 'freeshipper.php');
} else {
// All Other Shipping Modules
if(sizeof($products)>$indvcount){
while (list(, $value) = each($this->modules)) { //try foreach is faster//hadir
$class = substr($value, 0, strrpos($value, '.'));
// Don't show Free Shipping Module
if (($class !='freeshipper')/* && ($class != 'indvship')*/) {
$include_modules[] = array('class' => $class, 'file' => $value);
}
}
}}
// EOF: Free Shipping and Payments// EOF: Individual Shipping Prices
}


       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;
   }
//phpmom.com// find shiptotoal and indvcount(# of products with indv shipping//
function get_shiptotal() {
global $cart;
$this->shiptotal = '';
$products = $cart->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
// mod indvship//modified hadir
// if ($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(($products_ship_price) ||($products_ship_price_two)){
$this->shiptotal += ($products_ship_price);
if ($qty > 1) {
if ($products_ship_price_two) {
$this->shiptotal += ($products_ship_price_two * ($qty-1));
} else {
$this->shiptotal += ($products_ship_price * ($qty-1));
}
} }
} // first mod ok $this->shiptotal += ($products_ship_price * $qty);
// mod indvship//modified hadir
// first mod ok $this->shiptotal += ($products_ship_price * $qty);
// end indvship
return $this->shiptotal;
}

function get_indvcount() {
global $cart;
$this->indvcount = '';
$products = $cart->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
// mod indvship//modified hadir
// if ($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';
}
} // first mod ok $this->shiptotal += ($products_ship_price * $qty);
// mod indvship//modified hadir
// first mod ok $this->shiptotal += ($products_ship_price * $qty);
// end indvship
return $this->indvcount;
} //end phpmom.com

   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;
     }
   }
 }
?>

 

Any help hugely appreciated.

Link to comment
Share on other sites

I've just successfully tested this mod I've been working on - it's kind of like the other contribution by this name found here http://www.oscommerce.com/community/contributions,367 except with this one, I've created a separate database table to hold individual shipping prices that you can modify in your admin like any other product variable - which means you can keep your 'weight' field and use this contribution with any other shipping modules... such as 'multi vendor shipping' if you were so inclined.

If there's enough interest for this, I'll go ahead and package it as a contribution and upload it.

Link to comment
Share on other sites

I've just successfully tested this mod I've been working on - it's kind of like the other contribution by this name found here http://www.oscommerce.com/community/contributions,367 except with this one, I've created a separate database table to hold individual shipping prices that you can modify in your admin like any other product variable - which means you can keep your 'weight' field and use this contribution with any other shipping modules... such as 'multi vendor shipping' if you were so inclined.

If there's enough interest for this, I'll go ahead and package it as a contribution and upload it.

Link to comment
Share on other sites

Sorry for the post i am new to the forum but here what i am trying to say:

 

 

I can make other shipping modules display if I take out the Shipping Zone in the shipping modules but as soon as I add the shipping zone back in it does not show up on the list of choices. I removed this entire contribution just to test and there they were, readded the contribution and I cannot see the choices again.

 

I know in invphp it is not getting the delivery zone id when you have zones setup here is the code below somebody please help...At this statement from the code below it is not getting the delivery zone id

 

} elseif ($check['zone_id'] == $order->delivery['zone_id'])

 

<?php

/*

$Id: indvship.php,v 1.0 2003/07/07 00:00:01 hpdl Exp $

by D. M. Gremlin

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

class indvship {

var $code, $title, $description, $icon, $enabled, $shiptotal;

 

// class constructor

function indvship() {

global $order;

$this->code = 'indvship';

$this->title = MODULE_SHIPPING_INDVSHIP_TEXT_TITLE;

$this->description = MODULE_SHIPPING_INDVSHIP_TEXT_DESCRIPTION;

$this->sort_order = MODULE_SHIPPING_INDVSHIP_SORT_ORDER;

$this->icon = '';

$this->tax_class = MODULE_SHIPPING_INDVSHIP_TAX_CLASS;

$this->enabled = ((MODULE_SHIPPING_INDVSHIP_STATUS == 'True') ? true : false);

 

// Enable Individual Shipping Module

// $this->enabled = MODULE_SHIPPING_INDVSHIP_STATUS;

if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_INDVSHIP_ZONE > 0) ) {

$check_flag = false;

$check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_INDVSHIP_ZONE . "' 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 ($check_flag == false) {

$this->enabled = false;

}

}

}

Link to comment
Share on other sites

ok--just so we're all clear on this...

 

both database_tables.php files should have these lines of code:

 

define('TABLE_PRODUCTS_SHIPPING', 'products_shipping');

define('TABLE_SHIPPING_METHODS', 'shipping_methods');

 

 

(hehe....ahhh it takes some of us 3 hours to figure that out)

 

--gertie : )

Link to comment
Share on other sites

Sorry for the post i am new to the forum but here what i am trying to say:

I can make other shipping modules display if I take out the Shipping Zone in the shipping modules but as soon as I add the shipping zone back in it does not show up on the list of choices. I removed this entire contribution just to test and there they were, readded the contribution and I cannot see the choices again.?

 

I know in invphp it is not getting the delivery zone id when you have zones setup here is the code below somebody please help...At this statement from the code below it is not getting the delivery zone id

 

? } elseif ($check['zone_id'] == $order->delivery['zone_id'])

 

<?php

/*

? $Id: indvship.php,v 1.0 2003/07/07 00:00:01 hpdl Exp $

? by D. M. Gremlin

 

? osCommerce, Open Source E-Commerce Solutions

? http://www.oscommerce.com

 

? Copyright ? 2003 osCommerce

 

? Released under the GNU General Public License

*/

 

? class indvship {

? ? var $code, $title, $description, $icon, $enabled, $shiptotal;

 

// class constructor

? ? function indvship() {

? ? ? global $order;

? ? ? $this->code = 'indvship';

? ? ? $this->title = MODULE_SHIPPING_INDVSHIP_TEXT_TITLE;

? ? ? $this->description = MODULE_SHIPPING_INDVSHIP_TEXT_DESCRIPTION;

? ? ? $this->sort_order = MODULE_SHIPPING_INDVSHIP_SORT_ORDER;

? ? ? $this->icon = '';

? ? ? $this->tax_class = MODULE_SHIPPING_INDVSHIP_TAX_CLASS;

? ? ? $this->enabled = ((MODULE_SHIPPING_INDVSHIP_STATUS == 'True') ? true : false);

 

// Enable Individual Shipping Module

//? ? ? $this->enabled = MODULE_SHIPPING_INDVSHIP_STATUS;

? ? ? if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_INDVSHIP_ZONE > 0) ) {

? ? ? ? $check_flag = false;

? ? ? ? $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_INDVSHIP_ZONE . "' 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 ($check_flag == false) {

? ? ? ? ? $this->enabled = false;

? ? ? ? }

? ? ? }

? ? }

 

Any luck on figuring this out? I'm still stumped as well... :huh:

Edited by homewetbar

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Link to comment
Share on other sites

Hi,

 

I have kayaking gear shop. Currently I charge ?6.50 for orders under ?50 and free shipping above that (i use flat rate for this). This is great for the small stuff (most sales) however I want to be able to charge a set price for large items such as the kayaks and canoes.

 

Is this contrib what I want? If not, what is??

 

Cheers,

 

Lowri

Link to comment
Share on other sites

Hi,

 

I have kayaking gear shop. Currently I charge ?6.50 for orders under ?50 and free shipping above that (i use flat rate for this). This is great for the small stuff (most sales) however I want to be able to charge a set price for large items such as the kayaks and canoes.

 

Is this contrib what I want? If not, what is??

 

Cheers,

 

Lowri

I'm not sure how you would use it to charge indv. prices for some products and not others...

 

Also, I don't believe this contrib. is at a stable release yet - after trialling it, I wouldn't use it on a live shop - too many problems...

Link to comment
Share on other sites

This thing has been challenging but I'm sure it will be worth it. I're read and re-read the instructions, and have gone through the entire setup. My initial problem was the

 

Fatal error: Cannot redeclare class indvship

 

I double checked all the files to make sure those 2 lines weren't being used elsewhere, they weren't. I eventually made the error go away by commenting out line 14 on /admin/includes/modules/shipping/indvship.php

 

//  class indvship {

//    var $code, $title, $description, $icon, $enabled, $shiptotal;

 

Of course that left me with a spare } at the bottom of the file so I took that out too. Ta-da, the error went away and MODULE_SHIPPING_INDVSHIP_TEXT_TITLE now appears on my shipping modules list.

 

I turned it on with Tax Class -none- and Zone -none- then turned off all other shipping modules.

 

It doesn't do anything. I don't have an option to enter shipping prices in edit or add product view, and checkout stalls at shipping, which displays no shipping options.

 

This contrib is exactly what I need for this project, can anyone advise me on what I might have done wrong?

Link to comment
Share on other sites

ok I figured out part of the problem. There was only one indvship.php file in the most recent package and I uploaded it to both directories

 

modules/shipping

languages/english/modules/shipping

 

So of course it was trying to call that function twice ... it was the same file. I grabbed an older package and it had the correct files. Now the admin area modules page shows "Individual Shipping" as an option.

 

But I still don't see how to use it... there's no extra field to enter shipping cost when you create/edit a product.

 

Ideas?

Link to comment
Share on other sites

I know this is a simple mod but have been trying to find the english file to change the words in the admin from Indv. Shipping Price: to Shipping and Handling. Can someone tell me where the English file is for the shipping mod. I would like to also change the admin item words from Each Additional Price: something else.

 

Thanks

Link to comment
Share on other sites

Hello, this sounds like a great contribution, but i am having some problems, i have followed the instructions it came with but i get the error:

 

Fatal error: Call to a member function on a non-object in /onguard.us/includes/classes/order.php on line 153

 

this msg appears when i go to checkout_shipping.php

 

this is what is on those lines which i pasted from the insturctions:

 

 

150 //phpmom.com indv shipping

151 if($shipping['id']==indvship_indvship){

152 $shipping_cost = $shipping['cost']; }

153 else {$shipping_cost = $shipping['cost'] + $shipping_modules->get_shiptotal();}//end

 

any advice? please help.

 

Regards,

Jose

Edited by hyperlinkswebsites
Link to comment
Share on other sites

Ok first things first. I do not get online much anymore AT ALL..having home..kid...and boyfriend issues right now....Oh and exgirlfriend issues...his not mine >_<

 

Anyway if you have a problem AFTER you have the most recent release and searched the thread for your error (IT IS HERE BELIEVE ME) email me at my gmail account phpmom

 

also

 

I'm not sure how you would use it to charge indv. prices for some products and not others...

 

Also, I don't believe this contrib. is at a stable release yet - after trialling it, I wouldn't use it on a live shop - too many problems...

 

Everyone that has followed the instructions correctly and read other thread problems (Try Feb-March I think) have it workin. I have it working. Infact someone just installed it and emailed with a simple question on how to add currency to the indv shipping statement. Not trying to be rude or start something here because I won't finish 'cause like I said I don't get on the forum much..but if you have not READ and FOLLOWED ALL instruction CORRECTLY you WILL get errors.

 

 

skidude

The older version before '05 did not work like most people wanted. IT only allowed for indv shipping (I Think) actually I don't even know if it worked correctly at all. Start reading the forum starting Feb '05

 

PS if you email me a question that has been answered several times here..I will reply with "It has been answered several time" :P

q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

Link to comment
Share on other sites

Hi,

 

I have modified the db and files I think correctly. When I go to edit a product I now get the extra fields for individual shipping prices. However when I go to my index.php I get the following error:

 

Parse error: parse error, unexpected T_DOUBLE_ARROW in /home/httpd/vhosts/impsportclothing.com/httpdocs/includes/classes/shopping_cart.php on line 326

 

So I change the => on line 326 and the few below it to -> then it gives another error:

 

Parse error: parse error, unexpected T_OBJECT_OPERATOR in /home/httpd/vhosts/impsportclothing.com/httpdocs/includes/classes/shopping_cart.php on line 326

 

my code in shopping_cart.php looks like:

 

$products_array[] = array('id' => $products_id,

                                    'name' => $products['products_name'],

                                    'model' => $products['products_model'],

                                    'image' => $products['products_image'],

                                    'price' => $products_price,

                                    'quantity' => $this->contents[$products_id]['qty'],

                                    'weight' => $products['products_weight'],

                                    'final_price' => ($products_price + $this->attributes_price($products_id)),

                                    'tax_class_id' => $products['products_tax_class_id'],

                                    'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));

 

 

// added for shipping prices contrib

//Start individual shipping//phpmom.com

'products_ship_methods_id' -> $products_shipping['products_ship_methods_id'],

'products_ship_price' -> $products_shipping['products_ship_price'],

'products_ship_price_two' -> $products_shipping['products_ship_price_two'],

'products_ship_zip' -> $products_shipping['products_ship_zip'],

//end individual shipping// was here

 

        }

      }

 

 

      return $products_array;

 

If anyone could lead me in the right direction I would be most grateful!

 

The only other thing is I took out a part of code for shipping method as I read in this thread it wasn't needed and was giving me errors as a table was not found.

 

Thanks in advance!

Link to comment
Share on other sites

Okay I managed to resolve the above problem as I realised the code I pasted wasn't within the array :rolleyes:

 

However now I enabled individual shipping module and edited one of the products but when I add it to cart it only shows the 'per item' shipping. If I disable 'per item' and then add it to cart it just says

 

Shipping Method

This is currently the only shipping method available to use on this order.

 

Any Ideas what i'm doing wrong.... many, many thanks in advance!!! B)

Link to comment
Share on other sites

Okay I managed to resolve the above problem as I realised the code I pasted wasn't within the array  :rolleyes:

 

However now I enabled individual shipping module and edited one of the products but when I add it to cart it only shows the 'per item' shipping.  If I disable 'per item' and then add it to cart it just says

Any Ideas what i'm doing wrong.... many, many thanks in advance!!!  B)

 

 

I see now on the contribution page it says:

 

Added Feature:

 

If the Individual Shipping Prices is enabled and the price set in the Admin => Categories => Products

 

At checkout_shipping.pho page, only Individual Shipping Module will be visible and available. And if the Individual Price is not set for a product. You will get other Shipping Modules which you might be running besides Individual Shipping Mod.

 

This is not the case for me... I just get the 'per item' (best way) when going to checkout. I have enabled the module and set the price in the product settings.

 

Has anyone had the same problem?

Link to comment
Share on other sites

Hi everybody!

 

I'm using the latest release of OsCommerce.

 

I've just installed this contribution ang I've got too much problems. Someone have been fixed reading the posts, but now I have another one that several poeple have asked about it but unfortunately, nobody aswered.

 

Well, when I want to login in my account enterin my user name end my password, I get this error message:

 

Fatal error: Cannot redeclare class shipping in /home/httpd/vhosts/auxplaisirsaquatiques.ch/httpdocs/html/Shop/catalog/includes/classes/shipping.php on line 13

 

The class is declared in the application_top.php files, and followed by this lines that I've added as it's indicated in the instructions of this contrib.

 

So I comment this code

 

function tep_get_configuration_key_value($lookup) {
$configuration_query_raw= tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key='" . $lookup . "'");
$configuration_query= tep_db_fetch_array($configuration_query_raw);
$lookup_value= $configuration_query['configuration_value'];
return $lookup_value;
}

 

and then I got the following error:

 

 

 

Call to undefined function: tep_get_configuration_key_value() in /home/httpd/vhosts/auxplaisirsaquatiques.ch/httpdocs/html/Shop/catalog/includes/classes/shipping.php on line 45

 

Does somebody have any idea about how to correct this problem! Any help would be very, very, very appreciated!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...