Shipping module setting weight independent of number of items ordered
Our store sells large size photographs. The weight of the photographs are based on the weight of the tube that are used to ship them. If a customer orders multiple copies of the same photo I do not want to multiply the weight by the number of items ordered.
For such products I want to set the weight as a negative number and use that as a test to skip the logic for multiplying by the number of units. Of course the weight will be reset to positive equivalent after skiping the weight multiplication. Can somebody please guide me to the file where this calculation is done. Thanks in advance. The shipping module is USPS.
Re: Shipping module setting weight independent of number of items ordered
Set the amount for one
Add a handling fee for the tube
It will be added only once while the pics will be incremental
Re: Shipping module setting weight independent of number of items ordered
We also sell many items which are not photographs. In such a case I am not sure how to set the handling charge for some products only.
Re: Shipping module setting weight independent of number of items ordered
Quote:
We also sell many items which are not photographs. In such a case I am not sure how to set the handling charge for some products only.
This will require some custom code to make the determination
Advanced Search here for some pointers from Ajeh to another that needed something similar/special for firearms
search term shipping firearms - - with by Ajeh as the user name
Re: Shipping module setting weight independent of number of items ordered
Thanks Kobra. I found the thread and it is exactly what I am looking for. I would not have found it myself. Thanks again. Donuts for the team.:smile:
Re: Shipping module setting weight independent of number of items ordered
Our store is at www.arunachala.org/bookstore We sell books,
photographs, audio and video. We use USPS and most of the shipping weights are correctly calculated by the shopping cart. Large size photographs are shipped in a tube. The weight of the photograph is small compared to the weight of the tube. When a customer orders four copies of the same photograph the store multiplies the weight of each tube by four and bases the shipping cost on that. For photographs we do not want to do this because many photographs can fit into a single tube and customer needs to pay for one tube weight only regardless of how many similar photographs are purchased..
I had an idea to set the weights for these photographs negative and test for the sign of the weight to skip multiplication with number of items purchased for such photographs. However based on Kobra's reference to thread by Ajeh http://www.zen-cart.com/forum/showthread.php?t=165331
I wanted to set up a similar handling charge based not on category but products. I need to know if it possible to do it on item by item basis. Also what is the name of the variable to check.
Re: Shipping module setting weight independent of number of items ordered
Do you use any 0 weight for Free Shipping or Always Free Shipping products?
Have you some products_id of these Products that are shipped by Tube?
If I order 1 Tube Product how much?
If I order 3 Tube Products how much?
If I order 12 Tub Products how much?
Re: Shipping module setting weight independent of number of items ordered
I use 0 or zero weight for magazine subscriptions which are always free shipping. Our volume of sale is usually limited to a max of 3 or 4 copies of the same size. The tube weight is set to say .9 pounds. If a person orders 1 or 3 or 12 identical photogrphs I want the net weight to be 0.9 pounds not .9 times the number purchased. The category ID of one such photo is 5015. There four other items which are shipped this way with different IDs. I am using version 1.3.9f planning to upgrade soon.
Re: Shipping module setting weight independent of number of items ordered
You could customize the FREE SHIPPING freeshipper and Flat Rate flat shipping modules ...
Let's assume the Tube Products are products_id 193, 194, 195 and 196 ...
Edit the file:
/includes/modules/shipping/flat.php
and add the code in red:
Code:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
}
// bof: show if products_id 193, 194, 195 or 196 are in the cart
if (!IS_ADMIN_FLAG) {
global $cart;
$chk_products_in_cart = 0;
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '192');
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '193');
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '194');
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '195');
$full_count = $_SESSION['cart']->count_contents();
if ($chk_products_in_cart > 0 && $full_count == $chk_products_in_cart) {
$this->enabled = true;
} else {
$this->enabled = false;
}
}
// eof: show if products_id 193, 194, 195 or 196 are in the cart
if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {
Then, customize the file:
/includes/modules/shipping/freeshipper.php
Code:
// enable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_FREESHIPPER_STATUS == 'True') ? true : false);
}
// bof: do not show if products_id 193, 194, 195 or 196 are in the cart
if (!IS_ADMIN_FLAG) {
global $cart;
$chk_products_in_cart = 0;
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '192');
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '193');
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '194');
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '195');
if ($chk_products_in_cart > 0) {
$this->enabled = false;
}
}
// eof: do not show if products_id 12, 22, 27 or 122 are in the cart
if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FREESHIPPER_ZONE > 0) ) {
Now set the Flat Rate shipping rate to the cost for the Tube Products ...
If you want to use USPS so that you have the USPS shipping rate for 0.9 to obtain all of the methods, you could customize that for the file:
/includes/modules/shipping/usps.php
Code:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_USPS_STATUS == 'True') ? true : false);
}
// bof: show if products_id 193, 194, 195 or 196 are in the cart
if (!IS_ADMIN_FLAG) {
global $cart;
$chk_products_in_cart = 0;
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '192');
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '193');
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '194');
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '195');
if ($chk_products_in_cart > 0) {
$this->enabled = true;
}
}
// eof: adjust weight if products_id 193, 194, 195 or 196 are in the cart
if ($this->enabled) {
Then change the code:
Code:
// usps doesnt accept zero weight send 1 ounce (0.0625) minimum
$usps_shipping_weight = ($shipping_weight <= 0.0 ? 0.0625 : $shipping_weight);
// bof: show if products_id 193, 194, 195 or 196 are in the cart
if (!IS_ADMIN_FLAG) {
global $cart;
$chk_products_in_cart = 0;
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '192');
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '193');
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '194');
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '195');
if ($chk_products_in_cart > 0) {
if ($shipping_weight <= 0.0) {
$usps_shipping_weight = 0.9;
} else {
$usps_shipping_weight += 0.9;
}
}
}
// eof: adjust weight if products_id 193, 194, 195 or 196 are in the cart
$shipping_pounds = floor ($usps_shipping_weight);
Re: Shipping module setting weight independent of number of items ordered
Vow I am amazed at the bounty. It will take me time to digest all this. Will report to you after testing it. Thanks a million. Donuts on their way.:smile: