Hello colleagues! I have a question about pricing in the online store, and I can not come to any relatively correct decision.

There is an online store, for example, it will be toys. The online store has many suppliers, the positions overlap, that is, the same product can be at five suppliers at the same time, but prices and availability vary.

Let's say there is a toy car. It is available from two suppliers, and each of the suppliers in the warehouse. If the prices were approximately the same for all commodity items, this would be ideal, but the crisis with the currency in our Rush and the demand for certain goods do their dirty deed.

Picture

It happens that in some warehouses the price is significantly different from all other prices. I think the fact is that the goods are old, purchased before 2014, the price for it is two times lower.

Originally put prices on the method

$data = array( array('price'=>2005, 'amount' => 2), array('price'=>2006, 'amount' => 4), array('price'=>2007, 'amount' => 8), array('price'=>2007, 'amount' => 8), array('price'=>2007, 'amount' => 4), array('price'=>2007, 'amount' => 16) ); foreach ($data as $key => $row) { $price[$key] = $row['price']; $amount[$key] = $row['amount']; } array_multisort($price, SORT_ASC, $amount, SORT_DESC, $data); 

I took the first value of the $ data array and output the price = 2005 and availability = 2 to the site. This method does not seem to me to be correct, because it works only at relatively similar prices and availability in warehouses. Salt on the wound is now raining even when we have a price in 10 warehouses, say 3000 rubles, another in 10 warehouses, the price is 3500 rubles, and only in one warehouse the price is 1500 rubles and the quantity of goods is low. And according to my old formulas (when there were only a couple of suppliers), the minimum price with the maximum quantity of goods was displayed on the site. In the example described in php, the site will display the price of 2005 rubles with the presence of 2 pieces, and according to the data in the picture - a machine for 1500 rubles. This is fundamentally wrong, so now I am looking for new ways to optimize pricing.

Actually, the question itself : how to choose the optimal price automatically? Manual processing disappears, because the positions are more than one hundred thousand.

I work with php / mysql. In the database by product I have 4 tables: products, suppliers, warehouses, prices.

 - products (список Ρ‚ΠΎΠ²Π°Ρ€ΠΎΠ², 50ΠΊ ΠΏΠΎΠ·ΠΈΡ†ΠΈΠΉ) - suppliers (поставщики, id/Π½Π°Π·Π²Π°Π½ΠΈΠ΅/Ρ‚Π΅Π»Π΅Ρ„ΠΎΠ½Ρ‹, 10 ΡˆΡ‚ΡƒΠΊ) - warehouses (список складов, ΠΊΠ°ΠΆΠ΄Ρ‹ΠΉ склад привязан ΠΊ поставщику, ΠΏΠΎ 5 складов Π½Π° поставщика) - prices (Ρ†Π΅Π½Ρ‹ ΠΈ Π½Π°Π»ΠΈΡ‡ΠΈΠ΅ ΠΏΠΎ ΠΊΠ°ΠΆΠ΄ΠΎΠΌΡƒ Ρ‚ΠΎΠ²Π°Ρ€Ρƒ, ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ поставщика Π½Π° ΠΊΠ°ΠΆΠ΄ΠΎΠΌ складС) 

Described the structure for the general understanding that one product can account for up to 50 entries in a table with prices and availability.

Tell me where to go x_x

Thank!

  • one
    Maybe you should show the price in the form ΠΎΡ‚ ... Π΄ΠΎ ... ? - Visman
  • Yandex.Market will not miss such a chip - Andrew Koshkin
  • Calculate the arithmetic average and specify the entire quantity of the goods? - Visman
  • As one of the solutions to the problem - yes. - Andrew Koshkin
  • Then make a request with the desired grouping for the goods and two calculated fields: the amount for the field quantity, the amount for the field (price * quantity). The average price is obtained as dividing the second field into the first. - Visman

0