Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Add to UPS shipping price for one item?

Add to UPS shipping price for one item?

Locked

Views: 1,112

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
1 Dec 2010, 6:37 PM
#1
edacsac avatar

edacsac

New Zenner

Join Date:
Jul 2010
Posts:
8
Plugin Contributions:
0

Add to UPS shipping price for one item?

Hello,

I'm using the UPS shipping module for a customer and it's working great. Although, there is one item that requires a greater shipping/handling fee than what UPS calculates. How can I add to the UPS calculated shipping fee for one item, or can I have that one item use another shipping module?

Thanks!

1 Dec 2010, 6:49 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Add to UPS shipping price for one item?

You could test the cart for the products_id to get the quantity in the cart:
$_SESSION['cart']->in_cart_check('product_id','12')

Example: in the USPS shipping module to add 7.50 for each Product that is products_id 12 in the cart:
/includes/modules/shipping/usps.php

you can use:

          $cost = preg_replace('/[^0-9.]/', '',  $cost);
// bof: add additional 7.50 for each products_id 12 in the cart
global $cart;
$chk_cart_products_id_12 = $_SESSION['cart']->in_cart_check('products_id','12');
$additional_charge = $chk_cart_products_id_12 * 7.50;

          $methods[] = array('id' => $type,
                             'title' => $title,
                             'cost' => ($cost * $shipping_num_boxes) + $additional_charge + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );
// eof: add additional 7.50 for each products_id 12 in the cart

6 Dec 2010, 1:21 AM
#3
edacsac avatar

edacsac

New Zenner

Join Date:
Jul 2010
Posts:
8
Plugin Contributions:
0

Re: Add to UPS shipping price for one item?

Thank you Ajeh, that was really helpful. I appreciate it! Sorry it took so long to get back here and thank you.

6 Dec 2010, 5:01 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Add to UPS shipping price for one item?

You are most welcome ... thanks for the update that this worked for you ... :smile: