hello everyone I have a problem to expose you
I am trying to manipulate the StockAvailable.php file in class / stock / to register two custom fields of ps_product_attribute in ps_stock_available
"reference_uni" and "reference_uni_conf"
I cannot retrieve these two fields and have them recorded in the ps_stock_available table when updating the stock
I found the lines that record the quantities and I thought I would act on these lines (I attach image)
if (!$depends_on_stock) {
$id_stock_available = (int)StockAvailable::getStockAvailableIdByProductId($id_product, $id_product_attribute, $id_shop);
if ($id_stock_available) {
$stock_available = new StockAvailable($id_stock_available);
$stock_available->quantity = (int)$quantity;
$stock_available->reference_uni = "test1";
$stock_available->reference_uni_conf = "test2";
$stock_available->update();
} else {
$out_of_stock = StockAvailable::outOfStock($id_product, $id_shop);
$stock_available = new StockAvailable();
$stock_available->out_of_stock = (int)$out_of_stock;
$stock_available->id_product = (int)$id_product;
$stock_available->id_product_attribute = (int)$id_product_attribute;
$stock_available->quantity = (int)$quantity;
$stock_available->reference_uni = "test3";
$stock_available->reference_uni_conf = "test4";