You are here:  » How to handle MAP (Minimum Advertised Price)


How to handle MAP (Minimum Advertised Price)

Submitted by Convergence on Mon, 2013-05-20 17:42 in

Greetings,

Any thoughts how to handle products and brands that have MAP restrictions?

Couple of different scenarios:

1) Voucher code EXCLUSION (example: Apply voucher to entire store EXCEPT Brand1, Brand2, etc)
2) MAP Exclusion by Item and Brand: replace price with text - "Price too low to show" type of thing.

Ideas?

Submitted by support on Tue, 2013-05-21 08:20

Hi,

Regarding specific exclusions one way to do this would be a modification of the change described in this comment, and using the standard "!" operator to indicate NOT.

To try this, in includes/tapestry.php, look for the following code around line 188:

if ($voucher["match_value"])

...and REPLACE with:

if (strpos($voucher["match_value"],"&")!==FALSE)
{
  $parts1 = explode("&",$voucher["match_value"]);
  foreach($parts1 as $part1)
  {
    $parts2 = explode("=",trim($part1));
    if (substr($parts2[1],0,1)=="!")
    {
      $parts2[1] = substr($parts2[1],1);
      if ($product[$parts2[0]]==$parts2[1])
      {
        $isValid = FALSE;
        break;
      }
    }
    else
    {
      if ($product[$parts2[0]]!=$parts2[1])
      {
        $isValid = FALSE;
        break;
      }
    }
  }
}
elseif ($voucher["match_value"])

This new section of code will be invoked if the Match Criteria value contains "&" (making the Match Type and Match Field values redundant), so if a voucher code is valid for a particular merchant (voucher codes are per merchant anyway, but it will still need to be specified for this mod) but excludes Sony and Panasonic then you could use a Match Criteria of:

merchant=Merchant Name & brand = !Sony & brand = !Panasonic

Regarding MAP, if it would be feasible to manage a config file containing MAP exclusions, for example by creating the following code as feeds/map.php

<?php
$map
["Merchant 1"] = array("Brand 1","Brand 2");
$map["Merchant 2"] = array("Brand 3","Brand 4");
// etc.
?>

Then in html/prices.php, look for where the price is displayed by the following code around line 13:

<td><strong><?php print $config_currencyHTML.$product["price"]; ?></strong>

...and REPLACE with:

<td>
<?php require_once("feeds/map.php"); ?>
<?php if (!in_array($product["brand"],$map[$product["merchant"]])): ?>
<strong><?php print $config_currencyHTML.$product["price"]; ?></strong>
<?php else: ?>
<strong>Too Low To Show!</strong>
<?php endif; ?>

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Convergence on Tue, 2013-05-21 14:26

Thanks, David!

Will take a bit for me to wrap my head around it - but looking like these mods will be great!