In general, there is a section Promotions and discounts to which promotions are added. You can attach different products to each stock together with the promotional price, at least all several thousand items.
The field for the selection of goods and the promotional price of the goods is cloned into js, for each product there are separate fields.
Under the goods attached to the action created a separate table:
action_goods ------------ id action_id (id акции) good_id (id товара) good_name (Имя товара) action_price One to many relationship is obtained. So, when creating / editing a stock, every time I bang all the goods attached to the stock and re-record those products that are in shape.
I understand that if several thousand products are added to the stock, it’s not very healthy to overwrite them each time.
Otherwise, do not overwrite everything again, the promotional price may change and each time you will have to check whether this product is attached to the stock or not and, accordingly, select insert or update for each product.
That last option looks even worse.
Please advise how best to implement.