<?php
require_once "conexion.php";

if (isset($_GET["id"])) {
    $id = $_GET["id"];

    // Obtener el sell_price desde la tabla product_to_store
    $sql = "SELECT sell_price FROM product_to_store WHERE product_id = $id"; // Cambia "product_to_store" y "product_id" según tus necesidades
    $result = $conn->query($sql);

    if ($result->num_rows > 0) {
        $row = $result->fetch_assoc();
        $sellPrice = $row["sell_price"];
        $response = array("success" => true, "sellPrice" => $sellPrice);
    } else {
        $response = array("success" => false);
    }

    echo json_encode($response);
} else {
    $response = array("success" => false);
    echo json_encode($response);
}

$conn->close();
?>
