Jump to content

Bug in OrderDetail.php


middlesboro

Recommended Posts

Hello,

 

I noticed in table "order_detail" columns "product_quantity" and "product_quantity_in_stock" have always the same value. 

I supposed "product_quantity" is quantity from card and "product_quantity_in_stock" should be quantity of the product on stock in order time. For example:

 

On stock is 5 pieces. I ordered 3 pieces and in this moment "product_quantity_in_stock" should be 2 and "product_quantity" 3. But currently it will be "product_quantity_in_stock" 3 and "product_quantity" also 3.

 

I think problem is in file OrderDetail.php on line 634.

 

        $this->product_quantity_in_stock = ($product_quantity - (int)$product['cart_quantity'] < 0) ?
            $product_quantity : (int)$product['cart_quantity'];
 
I think it should be something like

 

        $this->product_quantity_in_stock = ($product_quantity - (int)$product['cart_quantity'] < 0) ?
            $product_quantity : $product_quantity - (int)$product['cart_quantity'];
 
I am using latest version 1.6. 
 
Am I right? Because it does not make a sense to me to have two columns with same values.
I need to know product quantity on stock after order. 
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...