Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / Built-in Shipping and Payment Modules / Handling charges based on product and destination country in USPS

Handling charges based on product and destination country in USPS

16 Oct 2011, 2:41 PM
#1
arunachala avatar

arunachala

Zen Follower

Join Date:
Mar 2009
Location:
New York
Posts:
158
Plugin Contributions:
0

Post #1 by arunachala

Our store uses USPS. We would like to charge different handling cost for some products depending on the destination country. I have the logic to identify the products. To check for the destination country I would like to use the following logic
if ($order->delivery['country']['id'] == '223' || $this->usps_countries == 'US') {

I need to know where the handling charge is calculated inside the USPS module so that I can change it? I am using version 1.3.9f:unsure:

16 Oct 2011, 2:50 PM
#2
ajeh avatar

ajeh

Oba-san

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

Post #2 by ajeh

Look for the cost ... similar to:

          $cost = preg_replace('/[^0-9.]/', '',  $cost);
          $methods[] = array('id' => $type,
                             'title' => $title,
                             'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );

You can use a variable instead of the:
MODULE_SHIPPING_USPS_HANDLING

in that code and set that variable to the Handling Fee that you want to use ...

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!

16 Oct 2011, 3:11 PM
#3
arunachala avatar

arunachala

Zen Follower

Join Date:
Mar 2009
Location:
New York
Posts:
158
Plugin Contributions:
0

Post #3 by arunachala

Thanks for the prompt reply. I will test it out. Starbucks coffee on its way!!

16 Oct 2011, 3:23 PM
#4
ajeh avatar

ajeh

Oba-san

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

Post #4 by ajeh

You are most welcome ... and thank you for your support!! :cool:

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!

16 Oct 2011, 4:34 PM
#5
ajeh avatar

ajeh

Oba-san

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

Post #5 by ajeh

You might peek at the Beta release of UPS and USPS for methods on having separate Handling based on National and International and see if this gives you a better start on it ...
http://www.zen-cart.com/forum/showthread.php?t=176606

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!

16 Oct 2011, 6:23 PM
#6
arunachala avatar

arunachala

Zen Follower

Join Date:
Mar 2009
Location:
New York
Posts:
158
Plugin Contributions:
0

Post #6 by arunachala

Thanks. I will check that out. Meanwhile I need to know the name of the variable that represents the total number of items in the cart. Is there a manual that holds the name of all the variable?

16 Oct 2011, 6:29 PM
#7
ajeh avatar

ajeh

Oba-san

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

Post #7 by ajeh

This will give you an array of all the products:

global $cart;
$_SESSION['cart']->get_products()

and this would give you the Item Count of the Products x Quantity:

global $cart;
$_SESSION['cart']->count_contents()

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!

16 Oct 2011, 6:33 PM
#8
arunachala avatar

arunachala

Zen Follower

Join Date:
Mar 2009
Location:
New York
Posts:
158
Plugin Contributions:
0

Post #8 by arunachala

Thanks.