I'm developing a shopping cart ...
I arrived in a party that ended up going wrong ... following the cart consists of additional product revenue and removal of ingredients
tabela produtos
id nome id_lanche preço
1 X-egg 1 7.00
2 X-tudo 2 9.00
tabela receita
id nome id_lanche preço quantidade (quantiodade no caso e quanto o produto tem de cada item)
1 alface 1 1.00 1
2 bacon 1 2.00 2
3 Cheddar 1 2.00 2
4 Bife 1 3.00 1
5 alface 2 1.00 1
6 bacon 2 2.00 2
7 Ovo 2 2.00 1
8 Bife 2 3.00 1
Tabela estoque
id nome quantidade
1 alface 10
2 bacon 5
It happens that there is 1 lettuce with id 1 and another with id 2 ... he can not identify the item to write off ... in stock I thought by name only that not that it is 100% effective ... if the name was spelled wrong it will not work ...
could you help me to develop an effective way?