我想在用户点击添加到购物车按钮时在我的html页面上添加弹出窗口。 Popupwindow只有在extra_option标志为yes时才需要打开。否则,它应该只是将产品添加到篮子里(这对我来说很好)。如何在我的HTML页面中添加弹出窗口
这是我的代码。
<form method="post">
<div class="col-md-12 col-sm-12 col-xs-12 pContainer">
<div class="col-md-3 col-sm-3 col-xs-12 wrap">
<div class="col-md-12 col-sm-12 col-xs-12 ">
<img src="img/delivery/products/<?=$r['ImgUrl'];?>" class="img img-responsive" style="width:auto">
</div>
</div>
<div class="col-md-9 col-sm-9 col-xs-12">
<div class="col-md-9 col-sm-9 col-xs-12 pNameNdiscription">
<h4> <b> <?=$r['ProductName']?> </b> </h4>
<p> <?=$r['Description']?> </p>
</div>
<div class="col-md-3 col-sm-3 col-xs-12 wrap" style="float:right" >
<div class="col-md-12 col-sm-12 col-xs-6 priceWrapper">
<h4 style="color:black" class="pPRICE"> <b> Rs. <?=$r['Price']?> </b> </h4>
</div>
<div class="col-md-12 col-sm-12 col-xs-6 add2CartWrapper">
<?php if($r['extra_option'] == 'yes') {
// if extra_option is 'yes' when user click on 'Add To Cart' I want to show here a popup widow to select the extra option. Otherwise just add the product into the cart.
// I am unable to properly add a model/popup windo.
<input type="button" id="ad2cart" name="ad2cart" class="btn add2Cart" value="Add To Cart" onclick='updateCart("<?=$r['id']?>")'>
}
</div>
</div>
</div>
<div class="col-sm-12 col-md-12 col-xs-12"> <hr> </div>
</div>
我不明白你的问题在这里。你只需要添加一个弹出的代码? Bootstrap内置了被称为“模态”的弹出窗口。 – ProEvilz