Hey everyone,
Is there any way to charge $4.99 for shipping on the first item and then $1.00 for each additional product added to the cart?
And then finally an option for priority mail at $2.49 added to the final cost?
Any help is appreciated!![]()
Hey everyone,
Is there any way to charge $4.99 for shipping on the first item and then $1.00 for each additional product added to the cart?
And then finally an option for priority mail at $2.49 added to the final cost?
Any help is appreciated!![]()
Use the Item Rate item shipping module with 1.00 per item and a handling charge of 3.99 ...
Then clone the Item Rate item to something like:
item.php itempriority.php
where item becomes itempriority and ITEM becomes ITEMPRIORITY
Copy the two files:
/includes/modules/shipping/item.php
/includes/languages/english/modules/shipping/item.php
/includes/modules/shipping/itempriority.php
/includes/languages/english/modules/shipping/itempriority.php
And add another 2.49 to the Handling charge ...
Now they can pick which ever one they want ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Thanks again for the quick reply!
I'm getting an error on my admin shipping module page after I uploaded the new itempriority.php file.
Here is the error I am getting:
Fatal error: Cannot redeclare class item in /home/.champ/farboenterprises/stickersftw.com/includes/modules/shipping/itempriority.php on line 11
Here is my itempriority.php file:
Any ideas what I'm doing wrong?Code:<?php /** * @package shippingMethod * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: itempriority.php 5501 2007-01-01 15:42:54Z ajeh $ */ class itempriority { var $code, $title, $description, $icon, $enabled; // class constructor function itempriority() { global $order, $db; $this->code = 'itempriority'; $this->title = MODULE_SHIPPING_ITEMPRIORITY_TEXT_TITLE; $this->description = MODULE_SHIPPING_ITEMPRIORITY_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_ITEMPRIORITY_SORT_ORDER; $this->icon = ''; $this->tax_class = MODULE_SHIPPING_ITEMPRIORITY_TAX_CLASS; $this->tax_basis = MODULE_SHIPPING_ITEMPRIORITY_TAX_BASIS; // disable only when entire cart is free shipping if (zen_get_shipping_enabled($this->code)) { $this->enabled = ((MODULE_SHIPPING_ITEMPRIORITY_STATUS == 'True') ? true : false); } if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_ITEMPRIORITY_ZONE > 0) ) { $check_flag = false; $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_ITEMPRIORITY_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); while (!$check->EOF) { if ($check->fields['zone_id'] < 1) { $check_flag = true; break; } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) { $check_flag = true; break; } $check->MoveNext(); } if ($check_flag == false) { $this->enabled = false; } } } // class methods function quote($method = '') { global $order, $total_count; // adjusted count for free shipping $itempriority_total_count = $total_count - $_SESSION['cart']->free_shipping_items(); $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_ITEMPRIORITY_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_ITEMPRIORITY_TEXT_WAY, 'cost' => (MODULE_SHIPPING_ITEMPRIORITY_COST * $itempriority_total_count) + MODULE_SHIPPING_ITEMPRIORITY_HANDLING))); if ($this->tax_class > 0) { $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order- >delivery['zone_id']); } if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title); return $this->quotes; } function check() { global $db; if (!isset($this->_check)) { $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ITEMPRIORITY_STATUS'"); $this->_check = $check_query->RecordCount(); } return $this->_check; } function install() { global $db; $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Item Shipping', 'MODULE_SHIPPING_ITEMPRIORITY_STATUS', 'True', 'Do you want to offer per item rate shipping?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_ITEMPRIORITY_COST', '2.50', 'The shipping cost will be multiplied by the number of items in an order that uses this shipping method.', '6', '0', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_ITEMPRIORITY_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_ITEMPRIORITY_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'zen_get_tax_class_title', 'zen_cfg_pull_down_tax_classes(', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Tax Basis', 'MODULE_SHIPPING_ITEMPRIORITY_TAX_BASIS', 'Shipping', 'On what basis is Shipping Tax calculated. Options are<br />Shipping - Based on customers Shipping Address<br />Billing Based on customers Billing address<br />Store - Based on Store address if Billing/Shipping Zone equals Store zone', '6', '0', 'zen_cfg_select_option(array(\'Shipping\', \'Billing\', \'Store\'), ', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_ITEMPRIORITY_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now ())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_ITEMPRIORITY_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); } function remove() { global $db; $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this ->keys()) . "')"); } function keys() { return array('MODULE_SHIPPING_ITEMPRIORITY_STATUS', 'MODULE_SHIPPING_ITEMPRIORITY_COST', 'MODULE_SHIPPING_ITEMPRIORITY_HANDLING', 'MODULE_SHIPPING_ITEMPRIORITY_TAX_CLASS', 'MODULE_SHIPPING_ITEMPRIORITY_TAX_BASIS', 'MODULE_SHIPPING_ITEMPRIORITY_ZONE', 'MODULE_SHIPPING_ITEMPRIORITY_SORT_ORDER'); } } ?>
Looks like you got a little carried away on the replacements ...
Also make sure you do not have any backup copies or additional copies on the server as that is a self loading directory ...Code:<?php /** * @package shippingMethod * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: itempriority.php 5501 2007-01-01 15:42:54Z ajeh $ */ class itempriority { var $code, $title, $description, $icon, $enabled; // class constructor function itempriority() { global $order, $db; $this->code = 'itempriority'; $this->title = MODULE_SHIPPING_ITEMPRIORITY_TEXT_TITLE; $this->description = MODULE_SHIPPING_ITEMPRIORITY_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_ITEMPRIORITY_SORT_ORDER; $this->icon = ''; $this->tax_class = MODULE_SHIPPING_ITEMPRIORITY_TAX_CLASS; $this->tax_basis = MODULE_SHIPPING_ITEMPRIORITY_TAX_BASIS; // disable only when entire cart is free shipping if (zen_get_shipping_enabled($this->code)) { $this->enabled = ((MODULE_SHIPPING_ITEMPRIORITY_STATUS == 'True') ? true : false); } if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_ITEMPRIORITY_ZONE > 0) ) { $check_flag = false; $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_ITEMPRIORITY_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); while (!$check->EOF) { if ($check->fields['zone_id'] < 1) { $check_flag = true; break; } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) { $check_flag = true; break; } $check->MoveNext(); } if ($check_flag == false) { $this->enabled = false; } } } // class methods function quote($method = '') { global $order, $total_count; // adjusted count for free shipping $item_total_count = $total_count - $_SESSION['cart']->free_shipping_items(); $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_ITEMPRIORITY_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_ITEMPRIORITY_TEXT_WAY, 'cost' => (MODULE_SHIPPING_ITEMPRIORITY_COST * $item_total_count) + MODULE_SHIPPING_ITEMPRIORITY_HANDLING))); if ($this->tax_class > 0) { $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title); return $this->quotes; } function check() { global $db; if (!isset($this->_check)) { $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ITEMPRIORITY_STATUS'"); $this->_check = $check_query->RecordCount(); } return $this->_check; } function install() { global $db; $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Item Shipping', 'MODULE_SHIPPING_ITEMPRIORITY_STATUS', 'True', 'Do you want to offer per item rate shipping?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_ITEMPRIORITY_COST', '2.50', 'The shipping cost will be multiplied by the number of items in an order that uses this shipping method.', '6', '0', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_ITEMPRIORITY_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_ITEMPRIORITY_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'zen_get_tax_class_title', 'zen_cfg_pull_down_tax_classes(', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Tax Basis', 'MODULE_SHIPPING_ITEMPRIORITY_TAX_BASIS', 'Shipping', 'On what basis is Shipping Tax calculated. Options are<br />Shipping - Based on customers Shipping Address<br />Billing Based on customers Billing address<br />Store - Based on Store address if Billing/Shipping Zone equals Store zone', '6', '0', 'zen_cfg_select_option(array(\'Shipping\', \'Billing\', \'Store\'), ', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_ITEMPRIORITY_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_ITEMPRIORITY_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); } function remove() { global $db; $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_SHIPPING_ITEMPRIORITY_STATUS', 'MODULE_SHIPPING_ITEMPRIORITY_COST', 'MODULE_SHIPPING_ITEMPRIORITY_HANDLING', 'MODULE_SHIPPING_ITEMPRIORITY_TAX_CLASS', 'MODULE_SHIPPING_ITEMPRIORITY_TAX_BASIS', 'MODULE_SHIPPING_ITEMPRIORITY_ZONE', 'MODULE_SHIPPING_ITEMPRIORITY_SORT_ORDER'); } } ?>
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Ugh. Thanks for all the help.
I managed to screw it up somehow.
I deleted the item.php file and then reuploaded it and now I'm getting and error and the shipping page during checkout shows up blank.
In the shipping modules admin area this error is displayed:
Fatal error: Cannot redeclare class item in /home/.champ/farboenterprises/5dollarpostershop.com/includes/modules/shipping/item.php on line 11
All I did was delete and reupload item.php.
I'm so confused by this.
Load the original item.php files:
/includes/modules/shipping/item.php
/includes/languages/english/modules/shipping/item.php
Next, copy these two files:
/includes/modules/shipping/item.php
/includes/languages/english/modules/shipping/item.php
to these twofiles:
/includes/modules/shipping/itempriority.php
/includes/languages/english/modules/shipping/itempriority.php
Then, delete the contents of:
/includes/modules/shipping/itempriority.php
and paste into it the code I posted above for the itempriority.php file ...
Finally, edit the file:
/includes/languages/english/modules/shipping/itempriority.php
and change all item to read itempriority and ITEM to read ITEMPRIORITY ...
Copy the files to the server ...
Install the Item Priority itempriority and see if it now works better ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
I did everything you said to do. The itempriority.php is no longer a problem.
However, I accidentally deleted the original item.php. I re uploaded the file and now in my admin area, when I click on shipping modules I get this error: Fatal error: Cannot redeclare class item in /home/.champ/***/***.com/includes/modules/shipping/item.php on line 11
Most of my shipping modules I had before I deleted the item.php files have dissapeared and now I am only left with 3. "Flat Rate" "Free Shipping Options" and "Free Shipping"
All the other have dissapeared and I am getting that error.
Also, during checkout, now when you get to shipping page, a blank white page is displayed.
What happened?
There is a screenshot of what I am seeing.