Ashraf Posted May 7, 2024 Share Posted May 7, 2024 / getP function Starts // function getp(){ global $db; $get_products = "select * from products order by 1 DESC LIMIT 0,8"; $run_products = mysqli_query($db,$get_products); while($row_products=mysqli_fetch_array($run_products)){ $pro_id = $row_products['product_id']; $pro_title = $row_products['product_title']; $pro_price = $row_products['product_price']; $pro_img1 = $row_products['product_img1']; $pro_label = $row_products['product_label']; $manufacturer_id = $row_products['manufacturer_id']; $get_manufacturer = "select * from manufacturers where manufacturer_id='$manufacturer_id'"; $run_manufacturer = mysqli_query($db,$get_manufacturer); $row_manufacturer = mysqli_fetch_array($run_manufacturer); $manufacturer_name = $row_manufacturer['manufacturer_title']; $pro_psp_price = $row_products['product_psp_price']; $pro_url = $row_products['product_url']; if($pro_label == "Sale" or $pro_label == "Gift"){ $product_price = "<del> ₹ $pro_price </del>"; $product_psp_price = "| ₹ $pro_psp_price"; } else{ $product_psp_price = ""; $product_price = "₹ $pro_price"; } if($pro_label == ""){ } else{ $product_label = " <a class='label sale' href='#' style='color:black;'> <div class='thelabel'>$pro_label</div> <div class='label-background'> </div> </a> "; } echo " <div class='col-md-4 col-sm-6 single' > <div class='product' > <a href='$pro_url' > <img src='admin_area/product_images/$pro_img1' class='img-responsive' > </a> <div class='text' > <center> <p class='btn btn-primary'> $manufacturer_name </p> </center> <hr> <h3><a href='$pro_url' >$pro_title</a></h3> <p class='price' > $product_price $product_psp_price </p> <p class='buttons' > <a href='$pro_url' class='btn btn-default' >View details</a> <a href='details.php?action=$pro_url' class='btn btn-primary'> <i class='fa fa-shopping-cart'></i> Add to cart </a> </p> </div> $product_label </div> </div> "; } } // getPro function Ends // ?> <?php getP();?> </div> <!--Container Main end--> Quote Link to comment https://forums.phpfreaks.com/topic/320499-view-and-add-to-cart-buttion-not-working/ Share on other sites More sharing options...
Ashraf Posted May 7, 2024 Author Share Posted May 7, 2024 Error 404 page not found Quote Link to comment https://forums.phpfreaks.com/topic/320499-view-and-add-to-cart-buttion-not-working/#findComment-1623489 Share on other sites More sharing options...
mac_gyver Posted May 7, 2024 Share Posted May 7, 2024 if the 'view details' link isn't working, there's something wrong with the 'product_url' value. what does the view source of the markup for that link show? you should be using a post method form for the add to cart operation, using a hidden field with the product id in it. Quote Link to comment https://forums.phpfreaks.com/topic/320499-view-and-add-to-cart-buttion-not-working/#findComment-1623495 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.