You are here:  » "Merchant Category" Mapping

Support Forum



"Merchant Category" Mapping

Submitted by steve on Tue, 2008-09-30 16:49 in

Hey :-)

Have you ever wrote a mod similar to how we map categories and products, but that allows us to map merchants instead? As I would like to display selected merchants (in the same format as the current browse merchants page) depending on a main merchant category.

So, in admin if I click on merchant mapping, I can create new "merchant category". i.e.
Entertainment.

Then I can configure Entertainment by adding the names of merchants I want to include in this merchant category. So I could add CDWOW, Play and Blah DVD.

Then, the url created would be www.yourdomain.com/merchantcategory/entertainment.
This page would now display, CDWOW, Play and Blah DVD.

How would I duplicate and edit the code used for the current mapping feature to be able to do this?

Cheers David!

Submitted by support on Wed, 2008-10-01 09:00

Hi Steve,

Would installing Price Tapestry in multiple sub-directories be an option; where you could use the sub-directory name to imply the top level category; which would give you both the merchant categorisation; and effectively sub-categories (the main category index of each site)?

Lots of users do this; and you can simply maintain a single master copy on your local computer (for customisation) and upload changes to each site...

Cheers,
David.

Submitted by steve on Wed, 2008-10-01 11:51

Hmm, I have just read a few threads in the forum about multiple installations. I don't think it would be best for what I need, as the site isn't that large and I need the search to query the whole database.

I really just want to be able to display selected merchants(layout same as merchant list) on a page. I thought the mapping would idea would work,

Or how about having a system similar to featured products. But instead of calling individual products, we could call the merchants instead. I could have separate files for each merchant category and add a table in the database for each file that would hold the selected merchants. Would this work?

Thanks, Steven

Submitted by steve on Thu, 2008-10-02 15:26

Hey David, is the above possible?

Basically duplicate the featured products feature and edit so it displays the merchants(layout like the merchant list) you type in rather than the products.

What would I need to edit in /admin/featured.php so instead of displaying products it would display merchants?

Thanks for your help,

Steven

Submitted by support on Thu, 2008-10-02 16:05

Hi Steven,

It's certainly possible to create an admin section to do this. However, if you are not likely to be changing the featured merchants that often, without any database work it would be straight forward to create a "Featured Merchants" page, for example:

featuredMerchants.php

<?php
  
require("includes/common.php");
  
// edit this list to change featured merchants
  
$featuredMerchants = array();
  
$featuredMerchants[] = "Merchant A";
  
$featuredMerchants[] = "Merchant B";
  
$featuredMerchants[] = "Merchant C";
  
$banner["h2"] = "<strong>Featured Merchants</strong>";
  require(
"html/header.php");
  require(
"html/menu.php");
  require(
"html/searchform.php");
  require(
"html/banner.php");
  foreach(
$featuredMerchants as $merchant)
  {
    if (
$config_useRewrite)
    {
      
$href $config_baseHREF."merchant/".tapestry_hyphenate($merchant)."/";
    }
    else
    {
      
$href $config_baseHREF."search.php?q=merchant:".urlencode($merchant).":";
    }
    print 
"<p><a href='".$href."'>".$merchant."</a></p>";
  }
  require(
"html/footer.php");
?>

Cheers,
David.

Submitted by steve on Thu, 2008-10-02 16:49

Thanks David, that works. How do I display the merchants like they are displayed in the merchant lists though? So using the same or similar template to /html/merchantatoz.php

Cheers Steven

Submitted by support on Thu, 2008-10-02 16:54

Hi Steven,

Easily patched into the atoz HTML module... Try this version:

<?php
  
require("includes/common.php");
  
// edit this list to change featured merchants
  
$featuredMerchants = array();
  
$featuredMerchants[] = "Merchant A";
  
$featuredMerchants[] = "Merchant B";
  
$featuredMerchants[] = "Merchant C";
  
$banner["h2"] = "<strong>Featured Merchants</strong>";
  require(
"html/header.php");
  require(
"html/menu.php");
  require(
"html/searchform.php");
  require(
"html/banner.php");
  
$atoz["items"] = array();
  foreach(
$featuredMerchants as $merchant)
  {
    if (
$config_useRewrite)
    {
      
$href $config_baseHREF."merchant/".tapestry_hyphenate($merchant)."/";
    }
    else
    {
      
$href $config_baseHREF."search.php?q=merchant:".urlencode($merchant).":";
    }
    
$item = array();
    
$item["name"] = $merchant;
    
$item["href"] = $href;
    
$atoz["items"][] = $item;
  }
  require(
"html/atoz.php");
  require(
"html/footer.php");
?>

...only caveat is that you would need to make sure that the list is in alphabetical order as this is normal done by the database, but that shouldn't be a problem...

Cheers,
David.