I'm making a cart for the web, and there's one thing I have to compare when I add a product to the cart. If the product that I add to the cart is for rent = id1 I will show a div and if the product that I add is any other one that has another id then I show another div.
Ok, I've differentiated it in PHP:
if($mitipo == 1){
echo "<div class=\"row justify-content-between\">
<div class=\"col detaCart\">Kit iniciación</div>
<div class=\"col-3 text-right detaCart\">99€</div>
</div>
<div class=\"txtGafas\">Gafas técnica, gafas paciente, garrafa de Gel conductor, caja de cuchillas</div>
<div class=\"row justify-content-between\">
<div class=\"col detaCart\"><small class=\"smallKit\">¿Incluir kit?</small></div>
<div class=\"col-3 text-right detaCart ui form\">
<div class=\"inline field\" style=\"vertical-align: -webkit-baseline-middle;\">
<div class=\"ui checkbox posCheck\">
<input type=\"checkbox\" tabindex=\"0\" class=\"hidden\">
</div>
</div>
</div>
</div>";
}else{
echo "<div class=\"row justify-content-between\">
<div class=\"col detaCart\">Kit iniciación</div>
<div class=\"col-3 text-right detaCart\">Incluido</div>
</div>
<div class=\"txtGafas\">Gafas técnica, gafas paciente, garrafa de Gel conductor, caja de cuchillas</div>";
}
What I do with that is to tell you if the product that is in the variable cart has the ID: 1 show me this div if it is any other show me the other, but of course if I add any one and then one with ID: 1 makes correct and changes the div of the cart, but if I do the reverse, ejp; I add one with Id: 1 and then another one takes away that div and I put the other one. How can I always tell you that there is a product with the Id: 1 that div always comes out ??? Thanks