You Just write below code, your query loop inside :
<?php echo get_post_meta($post->ID, “field_name”, true); ?>
Before you add Custome field name and set Field Name Value also in post.
that is all.
Hi below code for single product url. When you pass the query string in your url. You can use below code for single product url. Or you can put product id also here working fine.
<?php
$_productCollection=$this->getLoadedProductCollection();
$_helper = $this->helper(‘catalog/output’);
//Jai Write Below Code for Product id via getting Product URL Start
//redirect to old Product
if(isset($_GET[‘product_id’])){
$product_id = $_GET[‘product_id’];
$cProduct = Mage::getModel(“catalog/product”);
$cProduct->load($product_id);
//echo $cProduct->getImageUrl().”<br />”;
$currentProductURL = $cProduct->getProductUrl();
//echo $currentProductURL.”<br />”;
echo “<script type=’text/javascript’ language=’javascript’>window. location='”.$currentProductURL.”‘;</script>”;
}
//Jai Write Below Code for Product id via getting Product URL Start
?>
I have small knowledge in magento. So, I more then 3 hours spent for this code getting. If anyone find this post. This is useful for you.
thanks.
Below I mention that Reading Query String Script:
<!– Query String Read Code Start
function querySt(queryValue) {
queryString = window.location.search.substring(1);
urlSplitQuery = queryString.split(“&”);
for (i=0;i<urlSplitQuery.length;i++) {
finalQueryTxt = urlSplitQuery[i].split(“=”);
if (finalQueryTxt[0] == queryValue) {
return finalQueryTxt[1];
}
}
}
var queryFunction = querySt(“queryFunction”);
//document.write(queryString);
// Query String Read Code End –>
If you feel check conditon below i mention the query string condition:
if(queryString==”query”){
document.write(‘Yes query here’);
}
else{
document.write(‘no query’);
}