You are here:  » unused feeds, but to have an affilaite link to site

Support Forum



unused feeds, but to have an affilaite link to site

Submitted by Paul1107 on Mon, 2009-04-13 18:12 in

Hi David,

2 questions if you don't mind

1. some of my larger feeds that have bizarre categories segregation such as next and M&S that are feeds I cannot use until such time I can understand those categories. I still have them registered as a feed (but without any products downloaded). As I have a shop buy merchant page which includes all registered feeds with or without products registered, is there a way of having those without anyproduct registerd to have a link direct to the merchant so at least its not a deadlink?

2. I want to test the effectiveness of the featured products page against that of going straight through to the merchant to see if my conversion rate changes, and as don't operate a price comparison site it's not that important for me to have a featured page, but all the same good to test. Is there an easy way to change by merchant say, a direct link through to the merchant as an option on an ad hoc basis?

Thanks again Paul

Submitted by support on Tue, 2009-04-14 08:56

Hi Paul,

Regarding your first question - I'm not sure I understand what you mean by registered but no products imported - could you clarify if this answer doesn't help... There's no reason why you can't import without a category for the time being; after which your shop by merchant links would still work; it's just that no products would show up when doing a category search...

To make the links (from the search results) go direct to merchant for a selected merchants, that can be done quite easily in search.php. The product URL is generated by the following code beginning at line 164:

      if ($config_useRewrite)
      {
        $searchresults["products"][$k]["productHREF"] = "product/".tapestry_hyphenate($product["name"]).".html";
        if ($rewrite) $searchresults["products"][$k]["productHREF"] = "../../".$searchresults["products"][$k]["productHREF"];
      }
      else
      {
        $searchresults["products"][$k]["productHREF"] = "products.php?q=".urlencode($product["name"]);
      }

...so you could replace this with something like:

      $directMerchants = array();
      $directMerchants["Merchant 1"] = TRUE;
      $directMerchants["Merchant 2"] = TRUE;
      if ($directMerchants[$product["merchant"]])
      {
        $searchresults["products"][$k]["productHREF"] = tapestry_buyURL($product);
      }
      elseif ($config_useRewrite)
      {
        $searchresults["products"][$k]["productHREF"] = "product/".tapestry_hyphenate($product["name"]).".html";
        if ($rewrite) $searchresults["products"][$k]["productHREF"] = "../../".$searchresults["products"][$k]["productHREF"];
      }
      else
      {
        $searchresults["products"][$k]["productHREF"] = "products.php?q=".urlencode($product["name"]);
      }

Edit, add or remove from the $directMerchants array, replacing Merchant 1 etc. with actual merchant names exactly as they are registered on your site...

Cheers,
David.

Submitted by Paul1107 on Tue, 2009-04-14 09:43

David, sorry for not making myself clear on the first point.

When you put a feed into the feeds folder it shows in the admin page, I then do an import trial, this means that on the shop by store page the name of the merchant shows, but when clicking on the name, it only shows the 10 or so products included in the trial import.

On these instances when there is a full import pending, is there a way to have a link direct to the merchants site?

Is that any clearer?

Regards

Paul

P.S Thanks for the answer to q.2

Submitted by support on Tue, 2009-04-14 10:16

Hi Paul,

I get you - this is possible, but bear in mind that the only affiliate link available will be a deep-link to one of the product pages if that's acceptable; but perhaps in the first instance if you don't mind managing an array of direct affiliate links for merchants that are not yet set-up (just like in the mod for your q.2) you could do it that way. To try this, in merchants.php, the merchant link is generated by this code, beginning at line 16:

      if ($config_useRewrite)
      {
        $item["href"] = tapestry_hyphenate($feed["merchant"])."/";
      }
      else
      {
        $item["href"] = "search.php?q=merchant:".urlencode($feed["merchant"]).":";
      }

...try REPLACING that with:

      $directMerchants = array();
      $directMerchants["Merchant 1"] = "http://www.merchant1.com/?affiliate=1234";
      $directMerchants["Merchant 2"] = "http://www.merchant2.com/?affiliate=5678";
      if ($directMerchants[$feed["merchant"]])
      {
        $item["href"] = $directMerchants[$feed["merchant"]];
      }
      elseif ($config_useRewrite)
      {
        $item["href"] = tapestry_hyphenate($feed["merchant"])."/";
      }
      else
      {
        $item["href"] = "search.php?q=merchant:".urlencode($feed["merchant"]).":";
      }

...this time replacing the values in the array with the direct affiliate links of the merchants in the array....

Cheers,
David.

Submitted by Paul1107 on Tue, 2009-04-14 10:24

Thanks David,

I will give it a go over the next couple of days, see how we get on, as you're in semi-incommunicado until Sunday, that will give enough time to see how it works

Regards

Paul

Submitted by Rocket32 on Fri, 2009-05-01 02:44

Regarding the following code for question 2. Is there a way to let the Product Name link direct to the merchant's site and the for mor information link go the the product detail page on the PT site so the product page can get spidered PR link juice also. Sort of like giving the user option to get more details, buy now from merchant, or review or read reviews.

<?php
      $directMerchants 
= array();
      
$directMerchants["Merchant 1"] = TRUE;
      
$directMerchants["Merchant 2"] = TRUE;
      if (
$directMerchants[$product["merchant"]])
      {
        
$searchresults["products"][$k]["productHREF"] = tapestry_buyURL($product);
      }
      elseif (
$config_useRewrite)
      {
        
$searchresults["products"][$k]["productHREF"] = "product/".tapestry_hyphenate($product["name"]).".html";
        if (
$rewrite$searchresults["products"][$k]["productHREF"] = "../../".$searchresults["products"][$k]["productHREF"];
      }
      else
      {
        
$searchresults["products"][$k]["productHREF"] = "products.php?q=".urlencode($product["name"]);
      }
?>

Submitted by support on Fri, 2009-05-01 08:16

Hi,

Sure - the easiest way to go about this is probably first to implement the direct to merchant feature within html/searchresults.php rather than the above code. In which case, firstly disable the above by simply changing:

if ($directMerchants[$product["merchant"]])

...to:

if (0)

(ultimately the entire block can be removed of course but this is a quick way to override it whilst you test changes to html/searchresults.php).

Then, in html/searchresults.php you will find the code to render the URL behind the product name on lines 16 & 18 with the following:

<?php print $product["productHREF"]; ?>

...in each case, replace this with:

<?php print ($directMerchants[$product["merchant"]]?tapestry_buyURL($product):$product["productHREF"]); ?>

Cheers,
David.