Forums / Built-in Shipping and Payment Modules / Per Unit or Per Item Shipping Help?

Per Unit or Per Item Shipping Help?

Locked

Views: 7,760

Results 21 to 40 of 40
This thread is locked. New replies are disabled.
29 Oct 2010, 1:45 PM
#21
colortheworld avatar

colortheworld

New Zenner

Join Date:
Mar 2009
Posts:
68
Plugin Contributions:
0

Per Unit or Per Item Shipping Help?

Okay, look, here's the deal. I'm totally lost here, and I'm not sure what I am doing. So I'm going to break everything down one more time, and hopefully you (Ajeh) or somebody else can see what I'm trying to explain and guide me to light.

here is the website in question

https://www.mandbguns.com/zencart

Website currently has 3 categories:

  1. Custom Rifles for Sale (6 products currently)
  2. Guns for Sale (5 products currently)
  3. General Sales (2 products currently)

Products all have a set price and shipping weight

Shipping Module is USPS

Enable USPS Shipping
True

Enter the USPS Web Tools User ID


Which server to use
production

Handling Fee
50.00

Tax Class
Taxable Goods

Tax Basis
Shipping

Shipping Zone
--none--

Sort Order
1

All Packages are Machinable
False

USPS Options
--none--

Domestic Shipping Methods
PRIORITY

International Shipping Methods
--none--

Debug Mode
Off

In Shipping/Packaging I have the following:

Enter the Maximum Package Weight you will ship: 15

Package Tare Small to Medium - added percentage:weight: 0:0

Larger packages - added packaging percentage:weight: 10:0

I have no clue... I just went to go through 3 products, and got a shipping charge of just $62.50.

Now, I keep reading on USPS's site about a Rate Calculator, so I'm not sure if this is soemthing that needs to be turned on or not. Maybe that's the case? I don't know.

Again, I apologize for being so daft... this is the most confusing thing I've ever done on ZC. Any help is again, appreciated.

29 Oct 2010, 1:54 PM
#22
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Per Unit or Per Item Shipping Help?

colortheworld:

I have no clue... I just went to go through 3 products, and got a shipping charge of just $62.50.

Did you customize the file:
/includes/modules/shipping/usps.php

Zen-Venom Get Bitten

29 Oct 2010, 2:02 PM
#23
colortheworld avatar

colortheworld

New Zenner

Join Date:
Mar 2009
Posts:
68
Plugin Contributions:
0

Re: Per Unit or Per Item Shipping Help?

kobra:

Did you customize the file:
/includes/modules/shipping/usps.php

I haven't done any customization to it, no. I do have the file open though. Giving it a look to see what I would need to customize.

29 Oct 2010, 2:07 PM
#24
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Per Unit or Per Item Shipping Help?

colortheworld:

I just went to go through 3 products, and got a shipping charge of just $62.50.

I haven't done any customization to it, no. I do have the file open though. Giving it a look to see what I would need to customize.
What did you expect??
Ajeh outlined in fair detail what must be added

Zen-Venom Get Bitten

29 Oct 2010, 2:21 PM
#25
colortheworld avatar

colortheworld

New Zenner

Join Date:
Mar 2009
Posts:
68
Plugin Contributions:
0

Re: Per Unit or Per Item Shipping Help?

Well here's where I think I'm hung up.

Ajeh was in-depth with discussing a "calculation", but I'm not sure if she meant adding it to the module, or the database.

global $cart;
$chk_guns = $_SESSION['cart']->in_cart_check('master_categories_id','2');
$chk_rifles = $_SESSION['cart']->in_cart_check('master_categories_id','3');
$extra_handling_fee = ($chk_guns * 50) + ($chk_rifles * 35);

I realize that's a generalized run of the code, but I don't see that in the usps.php file, so that's what is throwing me off.

29 Oct 2010, 2:25 PM
#26
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Per Unit or Per Item Shipping Help?

colortheworld:

Ajeh was in-depth with discussing a "calculation", but I'm not sure if she meant adding it to the module, or the database.

Ajeh:

If you are using USPS shipping module, then you will want to customize the file:
/includes/modules/shipping/usps.php
I do not see the confusion??

Zen-Venom Get Bitten

29 Oct 2010, 2:28 PM
#27
colortheworld avatar

colortheworld

New Zenner

Join Date:
Mar 2009
Posts:
68
Plugin Contributions:
0

Re: Per Unit or Per Item Shipping Help?

kobra:

I do not see the confusion??

I guess the confusion then is I'm not the best with php code. I don't see any place in the usps.php file where I would add a calculation. This might be something I may have to pay somebody to assist with, now that I see it.

29 Oct 2010, 2:34 PM
#28
ajeh avatar

ajeh

Oba-san

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

Re: Per Unit or Per Item Shipping Help?

In the USPS shipping module:
/includes/modules/shipping/usps.php

you will see around line 229 the line:

          $cost = preg_replace('/[^0-9.]/', '',  $cost);

Below that line add:

global $cart;
$chk_guns = $_SESSION['cart']->in_cart_check('master_categories_id','2');
$chk_rifles = $_SESSION['cart']->in_cart_check('master_categories_id','3');
$extra_handling_fee = ($chk_guns * 50) + ($chk_rifles * 35);

This is calculating how many Guns from categories_id 2 and Rifles from categories_id 3, using the master_categories_id of the Products and multiplying them by 50 for Guns and 35 for Rifles ...

This creates the:
$extra_handling_fee

which holds this amount ...

Now add the $extra_handling_fee to the final cost in the next section of code:

          $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) + $extra_handling_fee  );

If you take out the 50.00 from the Handling Fee that you setup in the USPS shipping module, does this now add the correct additional cost?

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!

29 Oct 2010, 2:41 PM
#29
colortheworld avatar

colortheworld

New Zenner

Join Date:
Mar 2009
Posts:
68
Plugin Contributions:
0

Re: Per Unit or Per Item Shipping Help?

Hmm... I cannot find that line of code near line 229 or anywhere (using ctrl+f for "find") and this is on includes/modules/shipping/usps.php

Could this be a difference in version?

29 Oct 2010, 4:04 PM
#30
ajeh avatar

ajeh

Oba-san

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

Re: Per Unit or Per Item Shipping Help?

What version of Zen Cart are you running?

If you look at the file:
/includes/modules/shipping/usps.php

what does the version id line read?

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!

29 Oct 2010, 4:36 PM
#31
colortheworld avatar

colortheworld

New Zenner

Join Date:
Mar 2009
Posts:
68
Plugin Contributions:
0

Re: Per Unit or Per Item Shipping Help?

Ajeh:

What version of Zen Cart are you running?

If you look at the file:
/includes/modules/shipping/usps.php

what does the version id line read?

Using 1.3.8a, which, I am aware is due for the upgrade but we wanted to get things running before the upgrade.

29 Oct 2010, 4:45 PM
#32
ajeh avatar

ajeh

Oba-san

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

Re: Per Unit or Per Item Shipping Help?

You really need to run a current version of USPS ...

Look at the Known Bug Fixes for v1.3.8 ...
http://www.zen-cart.com/forum/showthread.php?t=82619

and at the Security Patches and Updates:
http://www.zen-cart.com/forum/showthread.php?t=131115

NOTE: upgrading to v1.3.9 from our Home page contain all of these and more ...

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!

29 Oct 2010, 4:51 PM
#33
colortheworld avatar

colortheworld

New Zenner

Join Date:
Mar 2009
Posts:
68
Plugin Contributions:
0

Re: Per Unit or Per Item Shipping Help?

Ajeh:

You really need to run a current version of USPS ...

Look at the Known Bug Fixes for v1.3.8 ...
http://www.zen-cart.com/forum/showthread.php?t=82619

and at the Security Patches and Updates:
http://www.zen-cart.com/forum/showthread.php?t=131115

NOTE: upgrading to v1.3.9 from our Home page contain all of these and more ...

okay, I was hoping to get this started and then upgrade, but it sounds like that may be the best course of action to just take now. thanks.

29 Oct 2010, 5:39 PM
#34
ajeh avatar

ajeh

Oba-san

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

Re: Per Unit or Per Item Shipping Help?

You can try upgrading just the USPS shipping module ... you need to load the current version to:
/includes/modules/shipping

and then save your settings to NotePad and do a REMOVE, INSTALL and reconfigure it ...

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!

29 Oct 2010, 6:40 PM
#35
colortheworld avatar

colortheworld

New Zenner

Join Date:
Mar 2009
Posts:
68
Plugin Contributions:
0

Re: Per Unit or Per Item Shipping Help?

Well, it's funny, I actually had the newer zencart installed on this domain anyway, so I've spent the last hour customizing it. I'm now working on shipping modules, so we'll see how this goes.

1 Nov 2010, 1:10 PM
#36
colortheworld avatar

colortheworld

New Zenner

Join Date:
Mar 2009
Posts:
68
Plugin Contributions:
0

Re: Per Unit or Per Item Shipping Help?

Morning, all.

Ajeh, I finally got around to placing that code into the shipping module and I did notice that for the books category (general sales) it printed out an accurate shipping, but not for the other two.

In fact, I tested on 2 products and got 15.74 and 10.25 respectively.

Now, I do have the weights set up on the products, so maybe I need to get rid of that?

1 Nov 2010, 1:49 PM
#37
ajeh avatar

ajeh

Oba-san

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

Re: Per Unit or Per Item Shipping Help?

You have lost me ...

Are you having a problem with Per Unit perweightunit or with USPS?

Both require weight to work ...

If using the Per Unit perweightunit then you need to probably adjust your Maximum Weight to 5000 and your Tare Rates to 0:0 ... if using USPS you need to adjust your Maximum Weight usually 50 but no more than 70 as USPS will not quote for over 70lbs packages via the rate quote ...

As to Book sales ... you know that they are books ... USPS does not know they are books ... it is just giving a quote for a book rate at that weight ...

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!

1 Nov 2010, 1:53 PM
#38
colortheworld avatar

colortheworld

New Zenner

Join Date:
Mar 2009
Posts:
68
Plugin Contributions:
0

Re: Per Unit or Per Item Shipping Help?

Ajeh:

You have lost me ...

Are you having a problem with Per Unit perweightunit or with USPS?

Both require weight to work ...

If using the Per Unit perweightunit then you need to probably adjust your Maximum Weight to 5000 and your Tare Rates to 0:0 ... if using USPS you need to adjust your Maximum Weight usually 50 but no more than 70 as USPS will not quote for over 70lbs packages via the rate quote ...

As to Book sales ... you know that they are books ... USPS does not know they are books ... it is just giving a quote for a book rate at that weight ...

My apologies. USPS. The maximum weight is at 50, but I don't think we'll really be dealing with anything over 20 lbs. So I could probably set it to 20.

and the "book sales" is just a set flat rate, which I haven't even weighed them yet so that seems irrelevant right now.

1 Nov 2010, 3:11 PM
#39
colortheworld avatar

colortheworld

New Zenner

Join Date:
Mar 2009
Posts:
68
Plugin Contributions:
0

Re: Per Unit or Per Item Shipping Help?

Okay so I adjusted the Maximum weight and that didn't change anything.

I'm actually running a test transaction because I want to see what goes on with USPS Module after the transaction. I've never used this module before, and I want to see what happens. If nothing major occurs then why couldn't I just set Shipping as an attribute, ya know?

1 Nov 2010, 3:14 PM
#40
ajeh avatar

ajeh

Oba-san

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

Re: Per Unit or Per Item Shipping Help?

You could set an Attribute on a Book to manage the Flat Rate per book, or you could customize the USPS shipping module where the books have 0 weight and you build a calculation on the Item Count for 0 weight products and multiple that by an amount and add that to the USPS quotes ...

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!