Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted (edited)

I'm using the Table shipping based on number of items v1.0 by Christian Lescuyer and Thomas Piskol to calculate shipping based on the items in the cart. The calculation is as follows:

 

1 item $5.00

2 items $ 8.00

3 items $11.00

4 items $14.00

 

There's no additional shipping for more than 5 items.

 

Theoretically, a cart with two items would have an $8.00 shipping charge. However when I use the described module the cart shows a shipping price for 3 items. Even an empty cart incurs a $5.00 shipping charge.

 

What am I doing wrong?

 

Thanks in advance,

 

eikeldesign :huh:

Edited by eikeldesign
Posted

what's the string you have for the rates?

 

is it like

1:5.00,2:8.00,3:11.00,4:14.00

Posted (edited)

Yes, it is. There was nothing in the description of the module telling me how to define the cost/ item, so I based it on the weight/item value/item options.

 

what's the string you have for the rates?

 

is it like

1:5.00,2:8.00,3:11.00,4:14.00

Edited by eikeldesign
Posted

yes, the code does not get into account the exact count. It has this code:

 

	  for ($i=0, $n=$size; $i<$n; $i+=2) {
	if ($order_total <= $table_cost[$i]) {
	  $shipping = $table_cost[$i+1];
	  break;
	}
  }

 

Change it to this in the table.php file

	  for ($i=0, $n=$size; $i<$n; $i+=2) {
	if ($order_total == $table_cost[$i]) {
	  $shipping = $table_cost[$i+1];
	  break;
	}
  }
  if( $i== $size ) {
	  $shipping = $table_cost[$i-1];
 }

 

try to see if its any better. Backup your file first.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...