You are here:  » Can Product page url be fetched from database?

Support Forum



Can Product page url be fetched from database?

Submitted by midsol on Tue, 2008-01-15 17:35 in

I have a question: I want to fetch the product url so I can set up an advertising campaign for the product. With product url I don't mean the product from the datafeed but the product url Price Tapestry creates after importing a feed. Can this data be fetched from database? I know I can get title, price etc from database but I can't seem to find the real product url only Search Name. Please let me know.

Greets,

Chris

Submitted by support on Wed, 2008-01-16 14:19

Hello Chris,

You can derive the Price Tapestry URL from any product as follows, $productName contains the name of the product:

<?php
  
if ($config_useRewrite)
  {
    
$url "http://www.example.com".$config_baseHREF."product/".tapestry_hyphenate($productName).".html";
  }
  else
  {
    
$url "http://www.example.com".$config_baseHREF."products.php?q=".urlencode($productName);
  }
?>

Hope this helps!
Cheers,
David.