Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Individual Product Shipping v4.3


bdx

Recommended Posts

I downloaded the latest version of this module. I am working on an unmodified OSC installation.

 

The documentation is alittle hard for me to follow. I have completed this steps. Here are the instructions:

 

Individual Product Shipping v4.3

Credit

D. M. Gremlin for starting this and creating the original contribution.

Farrukh Saeed for updating it. Also Keith W. and Frank M. for the fix to put shipping.php back in chechout files and out of application_top.php and some by Hadir Elba

Notes by Ed

 

* This package is a complete set of files that may be unzipped and uploaded to a new OSCommerce install. It is tested and working.

* If you already have modified files on your site, use a program like Beyond Compare 2 from www.scootersoftware.com to find the edits to add to your files.

* I have modified the previous contibution (so it works) and I changed it so that it will show either Individual Shipping rates or any other module you have installed. On my site I offer Individual Shipping for some light weight products or Canada Post Shipping for the rest. If a customer oders only light weight items, I want them to use the Individual Shipping option only, but if the order anything else or a combination of heavy and light items I want them to use Canada Post only. That is how these files are configured.

o If you do not want this either/or option, edit: catalog / includes / classes / shipping.php

+ comment line 51 - if (($class !='freeshipper') && ($class != 'indvship')) { // comment to show all ship options

+ uncomment line 52 - //if ($class !='freeshipper') { // uncomment to show all ship options

* You will need to add 1 table: use the following SQL command

o DROP TABLE IF EXISTS `products_shipping`;

CREATE TABLE `products_shipping` (

`products_id` int(11) NOT NULL default '0',

`products_ship_methods_id` int(11) default NULL,

`products_ship_zip` varchar(32) default NULL,

`products_ship_price` varchar(10) default NULL,

`products_ship_price_two` varchar(10) default NULL

) TYPE=MyISAM;

* You will need to modify 1 table: use the following SQL command

o INSERT INTO configuration VALUES ('', 'Indiv Ship Home Country', 'INDIVIDUAL_SHIP_HOME_COUNTRY', '223', 'Individual ship home country ID (other countries will have extra freight)', 7, NULL, '0000-00-00 00:00:00', '0000-00-00 00:00:00', NULL, NULL);

INSERT INTO configuration VALUES ('', 'Indiv Ship Outside Home Increase', 'INDIVIDUAL_SHIP_INCREASE', '3', 'Individual ship x increase for shipping outside home country. For example: If you set your item ship price to $50 and this value to 3 and ship outside your home country they will pay $150, and if this value was 2, they would pay $100.', 7, NULL, '0000-00-00 00:00:00', '0000-00-00 00:00:00', NULL, NULL);

* You will need to install this module through your: Admin panel > Modules > Shipping

* You will need to configure: Admin panel > Configuration > Shipping / Packaging

* You will need to configure: Admin panel > Categories / Products > each product to include the:

o TEXT_PRODUCTS_ZIPCODE: (I my own postal code, as I ship each item)

o Indv. Shipping Price:

o Each Additional Price:

* The original contribution included some items that are not from a new OSC install, so they have not been incorporated in this package. If you are having problems, you should check and see if any of these apply to you (note I have not checked the syntax or tested to see if these work, as my install did not require them):

o file: catalog / includes / application_top.php

+ remove: require(DIR_WS_CLASSES . 'shipping.php');

+ remove: $shipping_modules = new shipping;

o file: catalog / includes / application_top.php

+ If you gat an error like "cannot redeclare tep_get_configuration_key_value" or similar

+ try removing: starting at line 64

# // start indvship

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;

}

// end indvship

o file: catalog / includes / classes / shopping_cart.php

+ if you have:

# } elseif ($this->show_weight() == 0) (by Ed: not sure about this syntax)

+ replace it with:

# // start indvship

} elseif (($this->show_weight() == 0) && (tep_not_null($shipping_modules->get_shiptotal()))) {

//indv shipping

o file: catalog / includes / classes / shipping.php

+ If you have a Free Shipping Module installed then add the following:

+ After line 46:

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

}

# add:

# // start freeship

else {

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

// end freeship

+ add at line 60: }

o file: catalog / checkout_shipping.php

+ if you have:

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

+ change to:

# if (tep_get_configuration_key_value('MODULE_SHIPPING_FREESHIPPER_STATUS') and $cart->show_weight()!=0) {

o file: catalog / checkout_shipping.php

+ (if you use template changes here in template/checkout_shipping.tpl.php)

+ under:

# $radio_buttons = 0;

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

+ add:

# // start indvship

if(($quotes[$i]['id']== 'indvship') && (sizeof($quotes) > 1 && sizeof($quotes[0]) > 1)){

echo '<tr><td> </td>

<td colSpan="2" class="main">You have '.$shipping_modules->get_indvcount().' product with individual shipping total of '.$currencies->format($shipping_modules->get_shiptotal()).'. This total will be ADDED to the shipping method selected.</td><td> </td>

</tr>';}

else{

// end indvship

+ (can change above and add to language file)

+ under:

# $radio_buttons++;

}

}

?>

</table></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

}

}

+ add:

# } // indvship

o If you get an object error you will have to edit the following files:

+ catalog / checkout_confirmation.php

+ catalog / checkout_process.php

+ catalog / checkout_paypalipn.php

+ move:

# require(DIR_WS_CLASSES . 'shipping.php');

$shipping_modules = new shipping($shipping);

+ above:

# require(DIR_WS_CLASSES . 'order.php');

$order = new order;

o Remove the following code (unless you are using the ship method from another contibution) in: catalog / admin / categories.php

+ //Product shipping

$ship_method_array = array(array('id' => '', 'text' => TEXT_NONE));

$ship_method_query = tep_db_query("select methods_id, methods_name from " . TABLE_SHIPPING_METHODS);

while ($ship_method = tep_db_fetch_array($ship_method_query)) {

$ship_method_array[] = array('id' => $ship_method['methods_id'], 'text' => $ship_method['methods_name']);

}

//end Product shipping

+ reference info at: http://www.oscommerce.com/forums/index.php?sho...st&p=566919

* Best of luck and PayPal contibutions to my kids college fund are appreciated to [email protected]

 

 

 

I use Dreamweaver CS3 to modify site and FTP

 

I backup my site then replace all my local files with the ones provided in the pack and uploaded them to my server.

I created a table thru phpMyAdmin like it read in the documentation.

I installed the shipping module in my admin panel and configured

The shipping options appear in my product page

 

Im not sure about this step or what table im suppose to modify, or even if this is causing my problem

 

* You will need to modify 1 table: use the following SQL command

o INSERT INTO configuration VALUES ('', 'Indiv Ship Home Country', 'INDIVIDUAL_SHIP_HOME_COUNTRY', '223', 'Individual ship home country ID (other countries will have extra freight)', 7, NULL, '0000-00-00 00:00:00', '0000-00-00 00:00:00', NULL, NULL);

INSERT INTO configuration VALUES ('', 'Indiv Ship Outside Home Increase', 'INDIVIDUAL_SHIP_INCREASE', '3', 'Individual ship x increase for shipping outside home country. For example: If you set your item ship price to $50 and this value to 3 and ship outside your home country they will pay $150, and if this value was 2, they would pay $100.', 7, NULL, '0000-00-00 00:00:00', '0000-00-00 00:00:00', NULL, NULL);

 

When I view my site I get this error message:

Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/xxxxxxx/public_html/includes/header.php:214) in /home/xxxxxxxxxl/public_html/includes/boxes/categories.php on line 13

Link to comment
Share on other sites

Just installed this and seems to be working great. My only issue happens if say a customer puts a product with individual shipping in the cart then it would be $2.50 shipping. but if the person adds another if I dont put in each additional it will stay at the base price. Which is understandable. But for the item in particular if the customer orders more than 1 of it then I will have to send it out via parcel post (canada post). Is there anyway to make it so if the customer orders more than 1 of a particular item with individual shipping that it would switch to the regular canada post shipping module?

Link to comment
Share on other sites

  • 3 months later...
I downloaded the latest version of this module. I am working on an unmodified OSC installation.

 

The documentation is alittle hard for me to follow. I have completed this steps. Here are the instructions:

 

Individual Product Shipping v4.3

Credit

D. M. Gremlin for starting this and creating the original contribution.

Farrukh Saeed for updating it. Also Keith W. and Frank M. for the fix to put shipping.php back in chechout files and out of application_top.php and some by Hadir Elba

Notes by Ed

 

* This package is a complete set of files that may be unzipped and uploaded to a new OSCommerce install. It is tested and working.

* If you already have modified files on your site, use a program like Beyond Compare 2 from www.scootersoftware.com to find the edits to add to your files.

* I have modified the previous contibution (so it works) and I changed it so that it will show either Individual Shipping rates or any other module you have installed. On my site I offer Individual Shipping for some light weight products or Canada Post Shipping for the rest. If a customer oders only light weight items, I want them to use the Individual Shipping option only, but if the order anything else or a combination of heavy and light items I want them to use Canada Post only. That is how these files are configured.

o If you do not want this either/or option, edit: catalog / includes / classes / shipping.php

+ comment line 51 - if (($class !='freeshipper') && ($class != 'indvship')) { // comment to show all ship options

+ uncomment line 52 - //if ($class !='freeshipper') { // uncomment to show all ship options

* You will need to add 1 table: use the following SQL command

o DROP TABLE IF EXISTS `products_shipping`;

CREATE TABLE `products_shipping` (

`products_id` int(11) NOT NULL default '0',

`products_ship_methods_id` int(11) default NULL,

`products_ship_zip` varchar(32) default NULL,

`products_ship_price` varchar(10) default NULL,

`products_ship_price_two` varchar(10) default NULL

) TYPE=MyISAM;

* You will need to modify 1 table: use the following SQL command

o INSERT INTO configuration VALUES ('', 'Indiv Ship Home Country', 'INDIVIDUAL_SHIP_HOME_COUNTRY', '223', 'Individual ship home country ID (other countries will have extra freight)', 7, NULL, '0000-00-00 00:00:00', '0000-00-00 00:00:00', NULL, NULL);

INSERT INTO configuration VALUES ('', 'Indiv Ship Outside Home Increase', 'INDIVIDUAL_SHIP_INCREASE', '3', 'Individual ship x increase for shipping outside home country. For example: If you set your item ship price to $50 and this value to 3 and ship outside your home country they will pay $150, and if this value was 2, they would pay $100.', 7, NULL, '0000-00-00 00:00:00', '0000-00-00 00:00:00', NULL, NULL);

* You will need to install this module through your: Admin panel > Modules > Shipping

* You will need to configure: Admin panel > Configuration > Shipping / Packaging

* You will need to configure: Admin panel > Categories / Products > each product to include the:

o TEXT_PRODUCTS_ZIPCODE: (I my own postal code, as I ship each item)

o Indv. Shipping Price:

o Each Additional Price:

* The original contribution included some items that are not from a new OSC install, so they have not been incorporated in this package. If you are having problems, you should check and see if any of these apply to you (note I have not checked the syntax or tested to see if these work, as my install did not require them):

o file: catalog / includes / application_top.php

+ remove: require(DIR_WS_CLASSES . 'shipping.php');

+ remove: $shipping_modules = new shipping;

o file: catalog / includes / application_top.php

+ If you gat an error like "cannot redeclare tep_get_configuration_key_value" or similar

+ try removing: starting at line 64

# // start indvship

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;

}

// end indvship

o file: catalog / includes / classes / shopping_cart.php

+ if you have:

# } elseif ($this->show_weight() == 0) (by Ed: not sure about this syntax)

+ replace it with:

# // start indvship

} elseif (($this->show_weight() == 0) && (tep_not_null($shipping_modules->get_shiptotal()))) {

//indv shipping

o file: catalog / includes / classes / shipping.php

+ If you have a Free Shipping Module installed then add the following:

+ After line 46:

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

}

# add:

# // start freeship

else {

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

// end freeship

+ add at line 60: }

o file: catalog / checkout_shipping.php

+ if you have:

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

+ change to:

# if (tep_get_configuration_key_value('MODULE_SHIPPING_FREESHIPPER_STATUS') and $cart->show_weight()!=0) {

o file: catalog / checkout_shipping.php

+ (if you use template changes here in template/checkout_shipping.tpl.php)

+ under:

# $radio_buttons = 0;

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

+ add:

# // start indvship

if(($quotes[$i]['id']== 'indvship') && (sizeof($quotes) > 1 && sizeof($quotes[0]) > 1)){

echo '<tr><td> </td>

<td colSpan="2" class="main">You have '.$shipping_modules->get_indvcount().' product with individual shipping total of '.$currencies->format($shipping_modules->get_shiptotal()).'. This total will be ADDED to the shipping method selected.</td><td> </td>

</tr>';}

else{

// end indvship

+ (can change above and add to language file)

+ under:

# $radio_buttons++;

}

}

?>

</table></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

}

}

+ add:

# } // indvship

o If you get an object error you will have to edit the following files:

+ catalog / checkout_confirmation.php

+ catalog / checkout_process.php

+ catalog / checkout_paypalipn.php

+ move:

# require(DIR_WS_CLASSES . 'shipping.php');

$shipping_modules = new shipping($shipping);

+ above:

# require(DIR_WS_CLASSES . 'order.php');

$order = new order;

o Remove the following code (unless you are using the ship method from another contibution) in: catalog / admin / categories.php

+ //Product shipping

$ship_method_array = array(array('id' => '', 'text' => TEXT_NONE));

$ship_method_query = tep_db_query("select methods_id, methods_name from " . TABLE_SHIPPING_METHODS);

while ($ship_method = tep_db_fetch_array($ship_method_query)) {

$ship_method_array[] = array('id' => $ship_method['methods_id'], 'text' => $ship_method['methods_name']);

}

//end Product shipping

+ reference info at: http://www.oscommerce.com/forums/index.php?sho...st&p=566919

* Best of luck and PayPal contibutions to my kids college fund are appreciated to [email protected]

 

 

 

I use Dreamweaver CS3 to modify site and FTP

 

I backup my site then replace all my local files with the ones provided in the pack and uploaded them to my server.

I created a table thru phpMyAdmin like it read in the documentation.

I installed the shipping module in my admin panel and configured

The shipping options appear in my product page

 

Im not sure about this step or what table im suppose to modify, or even if this is causing my problem

 

* You will need to modify 1 table: use the following SQL command

o INSERT INTO configuration VALUES ('', 'Indiv Ship Home Country', 'INDIVIDUAL_SHIP_HOME_COUNTRY', '223', 'Individual ship home country ID (other countries will have extra freight)', 7, NULL, '0000-00-00 00:00:00', '0000-00-00 00:00:00', NULL, NULL);

INSERT INTO configuration VALUES ('', 'Indiv Ship Outside Home Increase', 'INDIVIDUAL_SHIP_INCREASE', '3', 'Individual ship x increase for shipping outside home country. For example: If you set your item ship price to $50 and this value to 3 and ship outside your home country they will pay $150, and if this value was 2, they would pay $100.', 7, NULL, '0000-00-00 00:00:00', '0000-00-00 00:00:00', NULL, NULL);

 

When I view my site I get this error message:

Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/xxxxxxx/public_html/includes/header.php:214) in /home/xxxxxxxxxl/public_html/includes/boxes/categories.php on line 13

 

 

Hi, just like you inserted the 1st set of SQL commands into the database in phpMyAdmin to create the database, you need to insert the other SQL commands into the db in phpMyAdmin to modify the configuration talble.

 

I don't know if this will solve your problem though :(

 

I also had problems with the instructions not being clear. The shipping isn't even showing on my checkout page :(

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...