Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shipping cost of 10.49 round to 10.00 in payment module


captkidd12

Recommended Posts

Ok, my web guy changed the coding as suggested on here and it still is rounding for us.

 

Here is my table rate:

 

20:4.75, 50:6.00, 75:8.00, 100:0.00

 

 

And currently I have a total of $68.97 in my cart and the shipping is saying I will be charged $8.00. This is incorrect, I should be charged $6.00. So, it is still rounding. What is the problem? Do I have the Table rates wrong? This shipping thing is driving me insane. Someone PLEEEEASE HELP!!!!!

Link to comment
Share on other sites

Ok, my web guy changed the coding as suggested on here and it still is rounding for us.

 

Here is my table rate:

 

20:4.75, 50:6.00, 75:8.00, 100:0.00

And currently I have a total of $68.97 in my cart and the shipping is saying I will be charged $8.00. This is incorrect, I should be charged $6.00. So, it is still rounding. What is the problem? Do I have the Table rates wrong? This shipping thing is driving me insane. Someone PLEEEEASE HELP!!!!!

 

If I am correct your table says:

0-20 = $4.75

20-50 = $6.00

50-75 = $8

75-100 = $0

 

So the quote is correct !

Link to comment
Share on other sites

Ok, my web guy changed the coding as suggested on here and it still is rounding for us.

 

Here is my table rate:

 

20:4.75, 50:6.00, 75:8.00, 100:0.00

And currently I have a total of $68.97 in my cart and the shipping is saying I will be charged $8.00. This is incorrect, I should be charged $6.00. So, it is still rounding. What is the problem? Do I have the Table rates wrong? This shipping thing is driving me insane. Someone PLEEEEASE HELP!!!!!

 

Hi Marie,

 

Your code is fine. With this rate table, you should be charged $8 for any purchase between $50 and $75. You need to change your table, if that's not what you want.

Link to comment
Share on other sites

Hi Marie,

 

Your code is fine. With this rate table, you should be charged $8 for any purchase between $50 and $75. You need to change your table, if that's not what you want.

 

 

Please forgive me....I am reading the table incorrectly. It's was a long night for me and this is exactly why I have a web guy doing this for me and not me personally.

 

Thank you all for your help. So, the code did work!!!!

 

:D

Link to comment
Share on other sites

  • 1 month later...

I'm having the same issue, except I'm using Multi-Vendor Shipping and the fix posted above doesn't seem to work for that, I also tried implementing the fix to the MVS code in checkout_shipping.php here:

 

I changed:

 

		  if (isset($quote['error'])) {
		tep_session_unregister('shipping');
	  } else {
		if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
		  $output[$vendor_id] = array('id' => $module . '_' . $method,
									  'title' => $quote[0]['methods'][0]['title'],
									  'ship_tax' => $ship_tax,
									  'products' => $products_array,
									  'cost' => $quote[0]['methods'][0]['cost']
									 );
		  $total_ship_tax += $ship_tax;
		  $total_shipping_cost += $quote[0]['methods'][0]['cost'];

 

To the following:

 

		  if (isset($quote['error'])) {
		tep_session_unregister('shipping');
	  } else {
		if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
		  $output[$vendor_id] = array('id' => $module . '_' . $method,
									  'title' => $quote[0]['methods'][0]['title'],
									  'ship_tax' => $ship_tax,
									  'products' => $products_array,
// >>> BEGIN - Modification to Fix Shipping Rounding Problem at Order Confirmation
//'cost' => $quote[0]['methods'][0]['cost']);
'cost' => sprintf("%f", $quote[0]['methods'][0]['cost'])

									 );
		  $total_ship_tax += $ship_tax;
		  $total_shipping_cost += sprintf("%f", $quote[0]['methods'][0]['cost']);

 

But the shipping is still rounded, I also tried the other changes as well, nothing works.

 

Please help me, I desperately need it.

 

Thank You,

 

James Black

Link to comment
Share on other sites

I am SO glad to find this thread and quickly, too, and the fix using sprintf does indeed work.

 

Before coming back here (I have been absent many months), I tried pinning this error down and was stumped except to recognize it was a rounding phenomenon.

 

This happened to a site of mine that had run correctly for a full year at ipowerweb on one of its oldest servers, but when we migrated it to a new vDeck server, voila ... rounding occurs.

 

Thank goodness for the osC forum and a robust user community! Happy Holidays to all.

Link to comment
Share on other sites

  • 2 weeks later...
I'm glad I found this thread but the fix, sadly, does not work for me. I use Zone rates and UK special Delivery and OSC is rounding, can anyone offer some guidance as how I might go about correctling this?

 

Thanks, Sarah

 

 

Oops, perhaps I should also say that the rounding occurs on the checkout_shipping.php page only, when I get to order_confirmation.php the values are correct!

Link to comment
Share on other sites

  • 3 weeks later...
Oops, perhaps I should also say that the rounding occurs on the checkout_shipping.php page only, when I get to order_confirmation.php the values are correct!

Can anyone help me understand why the zone rates change between the checkout_shipping.php and order_confirmation.php.

 

On checkout_shipping I have a value of $1.77 but when I get through to order_confirmation this value has been reduced to $1.63!! What heppens between/on order_confirmation to make this change?

 

I really hope someone can help me on this.

 

Sarah

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...