Jump to content

Changing the way product quantities are updated when placing an order


hd22

Recommended Posts

Hello,

 

I am currently developing a site using Prestashop (my first Prestashop project actually), with lots of custom stuff in it.

 

I need to change the way product quantities are decremented when an order is placed (talking about the `quantity`column of the `ps_product` table).

 

I've been searching in which file it is done, but still can't figure it out...

 

Anyone got a tip about it ?

 

Thanks !

Link to comment
Share on other sites

Ok, I found it.

 

It takes place at line 188 of the /classes/PaymentModule.php file :

 

if (Product::updateQuantity($product, (int)$order->id))
  $product['stock_quantity'] -= $product['cart_quantity'];
if ($product['stock_quantity'] < 0 && Configuration::get('PS_STOCK_MANAGEMENT'))
  $outOfStock = true;

 

Hope this helps someone else :)

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