Jump to content



* * * * * 2 votes

USPS Shipping Insurance


  • Please log in to reply
112 replies to this topic

#41   Dennisra

Dennisra
  • Members
  • 515 posts
  • Real Name:Joseph D. Jefferson
  • Gender:Male

Posted 17 March 2008 - 02:31 PM

Hi Scott:

I see you like a challenge. Me to.

I have updated to the newest  version 1.1.

I am using osCommerce PayPal IPN v2.3.0.0.

I cannot find the correct place in the ipn.php to make the edit as  I did in the  checkout_confirmation.php. I would like you to look at the ipn.php file so you could make a suggestion about adding the edit. I have posted a copy of the file here.

I am going to test a PayPal payment again. If the problem was solved by updating to the newest version I let you know here shortly.

Thanks for all your help.

View Postolsonsp4c, on Mar 17 2008, 02:47 AM, said:

Joseph,

You are correct.  Could you let me know which Paypal Module and version you are using?

One quick suggestion is to try making the same edit you made in checkout_confirmation.php to your Paypal file.

Scott


#42   Dennisra

Dennisra
  • Members
  • 515 posts
  • Real Name:Joseph D. Jefferson
  • Gender:Male

Posted 17 March 2008 - 02:56 PM

To make it clear what is happening.  

This is what the transaction should be:
  Sub-Total: $56.95
  United States Postal Service (1 x 0.52lbs) (First Class Mail (Estimated: 2 - 5 Days)): $2.32
  USPS Shipping Insurance: $2.05
  State Sales Tax: $3.70
  Total: $65.02

  
  
At PayPal
  Subtotal: $60.65
  Shipping and Handling: $2.32
  Tax: (6.500% in Minnesota): $3.94
  Total: $66.91 USD

It appears the sales tax is getting added to the cost of merchandise and the insurance charge does not get added to PayPal total.



#43   olsonsp4c

olsonsp4c
  • Members
  • 548 posts
  • Real Name:Scott Olson
  • Gender:Male
  • Location:Colorado Springs, CO

Posted 17 March 2008 - 03:41 PM

View PostDennisra, on Mar 17 2008, 07:56 AM, said:

To make it clear what is happening.  

This is what the transaction should be:
  Sub-Total: $56.95
  United States Postal Service (1 x 0.52lbs) (First Class Mail (Estimated: 2 - 5 Days)): $2.32
  USPS Shipping Insurance: $2.05
  State Sales Tax: $3.70
  Total: $65.02

  
  
At PayPal
  Subtotal: $60.65
  Shipping and Handling: $2.32
  Tax: (6.500% in Minnesota): $3.94
  Total: $66.91 USD

It appears the sales tax is getting added to the cost of merchandise and the insurance charge does not get added to PayPal total.


thanks for the update... i am out all day today, so I take a peek tomorrow.

if you need to, temporarily disable the mod so you don't lose money.

Scott

#44   kimm

kimm
  • Members
  • 30 posts
  • Real Name:Kim Hibma

Posted 17 March 2008 - 03:51 PM

View Postolsonsp4c, on Mar 17 2008, 03:37 AM, said:

A few more edits and let me know what happens:

FIND this:

	  $this->enabled = MODULE_OT_USPSINSURANCE_STATUS;

ADD this AFTER:

	  $this->tax_class = MODULE_OT_USPSINSURANCE_TAX_CLASS;

FIND this:

		$this->output[] = array('title' => $this->title . ':',
								'text' => $currencies->format($insurance, true, $order->info['currency'], $order->info['currency_value']),
								'value' => ($insurance * $shipping_num_boxes));

ADD this AFTER:

		if ($this->tax_class > 0) {
		  $this->output['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
		}

Let me know... i'm off to bed, hope this works...

Scott
Hey Scott,
Sorry but still no tax calculation. Have tried with the change to confirmation page and also with unchanged confirmation page. Have included all the changes to the order_total/ot_uspsinsurance.php file. Have different sort orders in admin side. No matter what I do it is not calculating sales tax on the insurance.

#45   olsonsp4c

olsonsp4c
  • Members
  • 548 posts
  • Real Name:Scott Olson
  • Gender:Male
  • Location:Colorado Springs, CO

Posted 19 March 2008 - 05:37 AM

I have released version 1.1a which addresses the Tax Class issue and correctly adds the insurance amount to the order total.

http://addons.oscommerce.com/info/5782

Scott

#46   olsonsp4c

olsonsp4c
  • Members
  • 548 posts
  • Real Name:Scott Olson
  • Gender:Male
  • Location:Colorado Springs, CO

Posted 20 March 2008 - 05:07 AM

View PostDennisra, on Mar 17 2008, 07:56 AM, said:

To make it clear what is happening.  

This is what the transaction should be:
  Sub-Total: $56.95
  United States Postal Service (1 x 0.52lbs) (First Class Mail (Estimated: 2 - 5 Days)): $2.32
  USPS Shipping Insurance: $2.05
  State Sales Tax: $3.70
  Total: $65.02

  
  
At PayPal
  Subtotal: $60.65
  Shipping and Handling: $2.32
  Tax: (6.500% in Minnesota): $3.94
  Total: $66.91 USD

It appears the sales tax is getting added to the cost of merchandise and the insurance charge does not get added to PayPal total.


Thanks for the clarity - it seems that it might be getting passed to Paypal actually... well, it might be - adding the insurance to the sub-total and then passing it on to Paypal, but there is extra coming from somewhere that is unaccounted for...  also, have you looked at this:

QUOTE(Aldebaran @ Dec 13 2007, 12:58 AM) *
Hi,
Running osCommerce 2.2-MS2 and installed the PayPal IPN module.

Get no errors, but if you enter a discount code, it is NOT getting passed to PayPal. PayPal uses the full amount and charges the full amount to customer, whether they have a credit card or are using a PayPal account.

I have the module set to aggregate, which others have said solved this issue, but this doesn't solve issue.

When you go back to store, the order shows the discounted amount and so does the email sent to customer - so there's a big mismatch.

All suggestions welcome rolleyes.gif

Everything else appears to work normally.

Jill


I have the same problems as you. discount and insurance do not pass to paypal. I tried the following way. I am not sure it will solve the problem until my customer buy one product. do you set up any thing in paypal-->profile-->shipping calculation???

1.) make sure you have your shipping mods. set up like you want in os.
2.)Log into your paypal account.
3.)Click on "profile"
4.)Click on "Set Up Shipping Calculations"
5.)Make sure there is NOTHING set up here.

thanks!

Scott

#47   Dennisra

Dennisra
  • Members
  • 515 posts
  • Real Name:Joseph D. Jefferson
  • Gender:Male

Posted 21 March 2008 - 01:52 AM

For now anyway I am just not accepting PayPal for payment of orders. That seems to make life a lot simpler.

#48   olsonsp4c

olsonsp4c
  • Members
  • 548 posts
  • Real Name:Scott Olson
  • Gender:Male
  • Location:Colorado Springs, CO

Posted 21 March 2008 - 06:11 PM

View PostDennisra, on Mar 20 2008, 06:52 PM, said:

For now anyway I am just not accepting PayPal for payment of orders. That seems to make life a lot simpler.

I use an older version of the Paypal IPN, version 1.4 by windfif and it works very will and does pass things along properly.  You might try that version.

Scott

Edited by olsonsp4c, 21 March 2008 - 06:26 PM.


#49   Dennisra

Dennisra
  • Members
  • 515 posts
  • Real Name:Joseph D. Jefferson
  • Gender:Male

Posted 21 March 2008 - 08:22 PM

View Postolsonsp4c, on Mar 21 2008, 01:11 PM, said:

Paypal IPN, version 1.4 by windfif
I will give that a try Scott. Thanks!

#50   birddogsgarage

birddogsgarage
  • Members
  • 49 posts
  • Real Name:hi

Posted 22 March 2008 - 02:25 PM

I do not see an option for the insurance in the admin
Modules
Order total
I just see
Low order fee
Shipping
Sub total
Tax
Total

Bu tI dont see anything resembling the instructions

Quote

**********
* STEP 6 *
**********

Activate in admin section of your site (Modules->Order Total) and edit the following settings.

1. Use Shipping Insurance?  Set to "True" if you want to use this module.
2. Insure Tax?  Set to "True" if you want to insure tax on packages shipped by USPS.
3. Customer Choice?  Set to "True" if you desire the shipping insurance checkbox to
   default to "unchecked" when the customer arrives at your checkout payment screen.
   The customer must choose to SELECT shipping insurance.  Set to "False" if you
   desire the shipping insurance checkbox to default to "checked" when the customer
   arrives at your checkout payment screen.  The customer must choose to DESELECT
   shipping insurance.
4. Sort Order?  Set this to the order you want it to appear in the totals table.
   See how your Order Total Modules have a Sort Order?  Well, I use Shipping
   as 3 and Shipping Insurance as 4.  Be careful NOT to have two modules with
   the same order number.  Note that ANY modules ordered after it, excluding
   shipping, will not be included in the total insured.
5. Insert accurate insurance amounts in the appropriate input boxes.  You can verify
   current rates at the USPS website.  Links are provided in the module description.


#51   birddogsgarage

birddogsgarage
  • Members
  • 49 posts
  • Real Name:hi

Posted 22 March 2008 - 03:34 PM

I got it
The files go in the catalog includes modules
NOT
admin include modules

Might want to change or reword

Quote

********************
* UPDATE 1.0->1.1a *
********************

1. Remove the module in the admin (Modules->Order Total)
2. Upload included fileset to the appropriate folders
3. Re-edit files in Step 1 & Step 4
4. Install the module in the admin and select appropriate options

in the readme file

The addition of admin  in

Quote

Remove the module in the admin (Modules->Order Total)
this line through it all off
But thats probably just me hahaha!

#52   olsonsp4c

olsonsp4c
  • Members
  • 548 posts
  • Real Name:Scott Olson
  • Gender:Male
  • Location:Colorado Springs, CO

Posted 02 April 2008 - 02:40 AM

View Postbirddogsgarage, on Mar 22 2008, 08:34 AM, said:

I got it
The files go in the catalog includes modules
NOT
admin include modules

Might want to change or reword
in the readme file

The addition of admin  in

this line through it all off
But thats probably just me hahaha!

Nope, understand - I've done the same thing in installing addons beating my head against the wall all because I just misunderstood or misread the instructions...

thanks for using my addon :)

Scott

#53   j4k3

j4k3
  • Members
  • 1 posts
  • Real Name:Jake

Posted 10 April 2008 - 01:47 AM

I have implemented the USPS Insurance module and everything was great.  However, now I find out I have to calculate tax on shipping and insurance for Florida.  I read all the posts in this thread and tried the suggestions.  I am running the latest 1.1a.  I have the order total modules aligned so tax is ordered below shipping and USPS Insurance.  However, it still does not calculate tax on the USPS Insurance.

For the other poster with the Paypal IPN version 2.3.3.0.  I found a solution that seems to work for me.  I edited the paypal_ipn.php file.

Around line 315 I added a definition for $uspsinsurance:
$subtotal = $order_total['ot_subtotal'];
$uspsinsurance = $order_total['ot_uspsinsurance']; /* MY EDIT */

Around line 454 I editing the following line to add $uspsinsurance to the handling variable:
$parameters['handling'] = number_format(($uspsinsurance+$order_total['ot_loworderfee']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));

The total comes out properly now in Paypal.  If only I could get tax calculated on the USPS Insurance my life would be all roses.

Thanks for any help, kind regards,
Jake

#54   olsonsp4c

olsonsp4c
  • Members
  • 548 posts
  • Real Name:Scott Olson
  • Gender:Male
  • Location:Colorado Springs, CO

Posted 11 April 2008 - 04:12 AM

Version 1.2 is out: http://addons.oscommerce.com/info/5782

Changes since v1.1
------------------
* Code added to calculate tax including the shipping insurance if a tax class is chosen (thanks to Jake)

Scott (olsonsp4c)

#55   Dennisra

Dennisra
  • Members
  • 515 posts
  • Real Name:Joseph D. Jefferson
  • Gender:Male

Posted 11 April 2008 - 02:18 PM

Really a nice contribution. Now my customers pay exactly what the shipping and insurance charges are. No more and no less. No more over or under charge for delivery. Makes for a happier customer.
Thank you!!!!!

#56   varanus9

varanus9
  • Members
  • 14 posts
  • Real Name:Phil Black
  • Gender:Male
  • Location:Eastern US

Posted 20 April 2008 - 02:46 AM

I have what might be a stupid question...Do you have to use the USPS shipping module to use this contribution, or will it work with any shipping module?

The store I built for a client (Stamps, as in Philately) just has a one dollar shipping rate for every order, but he wants customers to be able to have the option for insurance...will this work? I read all the posts in this thread and it seems to me it will, but I just want to check before I go through the install.

Thanks much

#57   olsonsp4c

olsonsp4c
  • Members
  • 548 posts
  • Real Name:Scott Olson
  • Gender:Male
  • Location:Colorado Springs, CO

Posted 20 April 2008 - 03:38 AM

View Postvaranus9, on Apr 19 2008, 07:46 PM, said:

I have what might be a stupid question...Do you have to use the USPS shipping module to use this contribution, or will it work with any shipping module?

The store I built for a client (Stamps, as in Philately) just has a one dollar shipping rate for every order, but he wants customers to be able to have the option for insurance...will this work? I read all the posts in this thread and it seems to me it will, but I just want to check before I go through the install.

Thanks much

It could work; however, you should note that the rates listed are the USPS insurance rates that are determined by the price of the order total (with or without tax).  It is easy to change the title of the module in the english file and adjust other aspects in the module file (ie. the usps logo).  You can change the insurance charge per order total amount in the admin to whatever you desire; however, you'd need to change the table inserted in checkout_payment.php accordingly (the insurance amounts charged.  You should take a look at the screenshots before using.

Thanks!

Scott

Edited by olsonsp4c, 20 April 2008 - 03:39 AM.


#58   varanus9

varanus9
  • Members
  • 14 posts
  • Real Name:Phil Black
  • Gender:Male
  • Location:Eastern US

Posted 20 April 2008 - 03:13 PM

View Postolsonsp4c, on Apr 19 2008, 11:38 PM, said:

It could work; however, you should note that the rates listed are the USPS insurance rates that are determined by the price of the order total (with or without tax).  It is easy to change the title of the module in the english file and adjust other aspects in the module file (ie. the usps logo).  You can change the insurance charge per order total amount in the admin to whatever you desire; however, you'd need to change the table inserted in checkout_payment.php accordingly (the insurance amounts charged.  You should take a look at the screenshots before using.

Thanks!

Scott

Thank you Scott! That's what I thought - he actually does use the USPS and their insurance rates, so that's fine - we just don't use any weight calculations for the site as the items weigh next to nothing, so it's easier just to use a flat rate, but it will be nice to have the optional insurance module in there...

Thanks again for the response...

Phil

#59   olsonsp4c

olsonsp4c
  • Members
  • 548 posts
  • Real Name:Scott Olson
  • Gender:Male
  • Location:Colorado Springs, CO

Posted 20 April 2008 - 03:43 PM

View Postvaranus9, on Apr 20 2008, 08:13 AM, said:

Thank you Scott! That's what I thought - he actually does use the USPS and their insurance rates, so that's fine - we just don't use any weight calculations for the site as the items weigh next to nothing, so it's easier just to use a flat rate, but it will be nice to have the optional insurance module in there...

Thanks again for the response...

Phil

Your welcome - you should also note that my module will only insure for 1 package per order at this time, until I figure out how to import the $shipping_num_boxes variable from the shipping class.  Once I figure that out, I already have it coded to work for multiple packages.

Scott

#60   olsonsp4c

olsonsp4c
  • Members
  • 548 posts
  • Real Name:Scott Olson
  • Gender:Male
  • Location:Colorado Springs, CO

Posted 13 May 2008 - 07:27 AM

ANNOUNCEMENT:

Everybody!  USPS changed almost all of their domestic and international insurance rates TODAY... Go in the admin->modules->order totals->USPS Shipping Insurance to see the links to the rates pages and update your rates in the addon accordingly or you'll be undercharging your customers (your checkout shipping [checkout payment in older versions] page will be automatically updated when you adjust the price in the admin)!

Also, anyone out there willing to help me figure out how to import the $shipping_num_boxes variable from the shipping class?  Once that is done, this addon will be complete...

Scott

Edited by olsonsp4c, 13 May 2008 - 07:30 AM.