Jump to content

Sql error Stock Available id_product_attribute is empty


Recommended Posts

Hello.

 
I want to let you know that we have some problem whit the new update of Prestashop 1.6.1.2. 
 
1. When a client place an order, we can not see the products in the order only the client information, but no products. 
We have enabled the debugg mode and this error appear "Stock Available id_product_attribute is empty" Please see attachement   Screenshot 2015-11-11 11.56.27.png
 
2. When we try to add a product to an existing order we  get the same error  ( "Stock Available id_product_attribute is empty" ) but not every time. Please see attachement  Screenshot 2015-11-11 16.28.09.png
 
3. Sometime our Prestashop generate a hight I/O usage, I do not know if this can affect te functionality. Please see attachement Livechart.png
 
If someone has any ideea how to fix this, please let me know.
 
Thank you, very much!

post-773291-0-01831500-1447318072_thumb.png

post-773291-0-36340900-1447318084_thumb.png

post-773291-0-43682600-1447318171_thumb.png

Link to comment
Share on other sites

Have you reported the issue to the Prestashop Forge?

 

Some things to consider.

1) Does this product have stock?

2) Are you using advanced stock management or multistore?

3) Did you add this product manually from the back office, or did you import the product using CSV file or some module or migration service?

4) Is this a clean install of Prestashop, or did you upgrade from a previous version.  If you performed an upgrade, then does this issue exist on a clean install of Prestashop?

Link to comment
Share on other sites

Hello Bellini13

 

I have not reported this issue to Prestashop forge.

 

To respond to you questions: 

 

1. the product do not have stock or is suppose to not have any stock.

2 . We do not use advance stock managenent, but we DO use MULTISOTRE.

3  All the products are added manualy in back office.

4. We did update from a previous verion . We have not tested on a clean install. 

 

www.zootehnice.ro is the main sotre and www.europrodhd.ro is the secondary store. 

Link to comment
Share on other sites

  • 1 month later...

Our problem was fixed by someone that we work whit. 

 

The problem was in the ps_stock_available table in database. Some records were missing after we made the upgrade to Prestashop 1.6.1.2. Our guy has created a script (stock_available_fix.php) to find and restore missing records.

 

The number of records in the table are 2741 vs 2002 before the fix. I believe the problem was rather related to old products with ID < 700.

 

I hope that this can help you.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Hi,

 

I have the same problem. It make error 505 in last step of order. Do you have solution for this?

 

LOG: *ERROR* 2015/12/18 - 15:25:16: Property StockAvailable->id_product_attribute is empty at line 909 in file classes/ObjectModel.php

 

Thank you.

It is a bug in file Core/Business/Stock/Core_Business_Stock_StockManager.php at line 126

 

you should have like this:

 

 

$stockAvailable->quantity = $stockAvailable->quantity + $delta_quantity;

$stockAvailable->id_product = (int)$product->id;

$stockAvailable->id_product_attribute = (int)$id_product_attribute;

$stockAvailable->update(); 

  • Like 4
Link to comment
Share on other sites

  • 1 month later...
  • 6 months later...
  • 2 months later...

No script needed, just as Sashok said : 

 

 

It is a bug in file Core/Business/Stock/Core_Business_Stock_StockManager.php at line 126

 
you should have like this:


$stockAvailable->quantity = $stockAvailable->quantity + $delta_quantity;
$stockAvailable->id_product = (int)$product->id;
$stockAvailable->id_product_attribute = (int)$id_product_attribute;
$stockAvailable->update();

 

It worked fine for me,

Charlotte

  • Like 3
Link to comment
Share on other sites

  • 4 months later...

It is a bug in file Core/Business/Stock/Core_Business_Stock_StockManager.php at line 126

 

you should have like this:

 

 

$stockAvailable->quantity = $stockAvailable->quantity + $delta_quantity;

$stockAvailable->id_product = (int)$product->id;

$stockAvailable->id_product_attribute = (int)$id_product_attribute;

$stockAvailable->update(); 

 

Thank you. It worked for me too (PrestaShop 1.6.1.5).

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