Hi php ppl! I have some code that I want to insert into a table. The problem is its a module that I am calling and I can use html in between them. I have to like escape it out properly and I donno how to do it..Basicaly wat I want to do is this :
<table border="0" cellpadding="0" width="56%">
<tr>
<td width="38%" valign="top">$Image
<p>$Price</p>
<p>$Add to cart</td>
<td width="62%" valign="top">$Product Name
<p>$Product_s_desc</td>
</tr>
<tr>
<td width="38%"></td>
<td width="62%"></td>
</tr>
</table>
Now that looks simple enough.. The tricky part is inserting these table tags around this code! :
function show_snapshot($product_sku) {
global $ps_vendor_id, $sess;
$db = new ps_DB;
$q = "SELECT * from product WHERE product_sku='$product_sku'";
$db->query($q);
if ($db->next_record()) {
$price = $this->get_price($db->f("product_id"));
echo "<B>".$db->f("product_name")."</B>\n";
echo "<BR>\n";
$url = "?page=".$this->get_flypage($db->f("product_id"));
if ($db->f("product_parent_id")) {
$url = "?page=".$this->get_flypage($db->f("product_parent_id"));
$url .= "&product_id=" . $db->f("product_parent_id");
} else {
$url = "?page=".$this->get_flypage($db->f("product_id"));
$url .= "&product_id=" . $db->f("product_id");
}
echo "<A HREF=". $sess->url(URL . $url).">";
$this->show_image($db->f("product_thumb_image"), "border=0");
echo "</A>";
echo "<BR>\n";
echo "<B>".$db->f("product_s_desc")."</B>\n";
echo "<BR>\n";
echo "Price:" . $price["product_price"] . " " . $price["product_currency"];
echo "<BR>\n";
$url = "?page=shop/cart&func=cartAdd&product_id=" . $db->f("product_id");
echo "<A HREF=". $sess->url(URL . $url).">Add to Cart</A><BR>\n";
}
else {
// Product SKU not found
return False;
}
I sincerely hope someone can help me with this 🆒
thanks in advance
Rich