Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Looking for a way to allow whole numbers only of Qty.


JoeWoodworker

Recommended Posts

I just received an order for a 1.5 quantity of a product.

I dont know why the customer did this. Osc calculated everything correctly but I cant ship a half product.

 

 

Any solutions would be sincerely appreciated.

 

Thanks

Joe

Evil will always triumph over good...

Because good is dumb.

- D.H.

Link to comment
Share on other sites

The email that was sent to the customer shows the product calculated at at 1.5 of the price and the total at the bottom is correct (1.5 x 14.95).

 

Here's where it gets weird...On the admin/invoice, it shows the whole number ordered (1) and priced at a qty of 1. BUT... the invoice total is wrong. It is actually totalled based on the 1.5 quantity pricing.

 

In other words, eventhough it displays 1 x $14.95, the invoice total adds a ghost charge of $7.48 for the half unit.

 

I am using 2.2CVS 11/28 snapshot.

Evil will always triumph over good...

Because good is dumb.

- D.H.

Link to comment
Share on other sites

Try this,

 

in includes/classes/shopping_cart.php find the line

 

    function add_cart($products_id, $qty = '', $attributes = '', $notify = true) {

     global $new_products_id_in_cart, $customer_id;

 

and straight after add

 

if ($qty>0) $qty = round($qty);



BTW I don't know where he is, but I know where he should be, back in the studio recording, where he belongs.

Trust me, I'm an Accountant.

Link to comment
Share on other sites

Just to be serious, round works as follows

 

round(1.2) = 1

round(1.6) = 2

 

ceil() always rounds up. I think what Marcel is suggesting is that ceil() is better from a shopkeepers point a view.

Trust me, I'm an Accountant.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...