I need to save on every order the manufacturers_id from the product (i already have the cell in the table) but i don't know how to make a hook that it's inserted on every product, can somebody help me here? thanks in advance!
Code: Select all
class hook_shop_siteWide_ordersProductsManufacturersId {
//Save in DB
function listen_insertOrder($parameters) {
$ordersProducts = &$parameters['sql_data']['orders_products'];
foreach ($ordersProducts as $i => $product) {
$manufacturers_id = Query in the products_table for the ID
$ordersProducts[$i]['manufacturers_id'] = $manufactures_id ?? '';
}
}
}