Modify BANS to Include eBay Store Items

September 28, 2009 by  
Filed under BANS Tutorials

There has been a lot of discussion over at the BANS and ePN forums about modifying the BANS code to the new eBay RSS feeds that include store inventory. I thought I would give it a shot last night and this is what I came up with.

It’s still a work in progress but if you’re links aren’t cloaked then this is a good fix for ya. I will post updates when I get the cloaked links converted.

***REMEMBER TO BACKUP YOUR FILES BEFORE PROCEEDING***

Edit the FrontControl.php (found in the cont folder)

  • Search for RSSFEEDS
  • Replace:
    if ($cloak == '1'){
    if ($this->categoryname != ''){
    $RSSFEEDS = array(
    0 => "http://rss.api.ebay.com/ws/rssapi?FeedName=SearchResults&siteId=".$siteid."&output=RSS20&sacat=".$this->catid."&ftrt=1&fbd=1&sabdlo=".$this->minbid."&sabdhi=".$this->maxbid."&saprclo=".$this->minprice."&saprchi=".$this->maxprice."&floc=1&saslop=1&fsop=$this->sort&fsoo=$this->fsoo&from=R6&fss=".$this->fss."&sasl=".$this->sellerid."&sacur=0&afepn=".CJID."&customid=".$this->sid."&saslc=0&fcl=3&saaff=afepn&catref=C5&frpp=100&satitle=".urlencode($sitewidequery)."+".urlencode($this->q)."&ftrv=1&fts=$srchdesc&".$sitenum."&sascs=".$this->bin."&fspt=".$this->local."&fpos=".$this->zip."&sadis=".$this->miles."&frts=$frts",
    );
    } else {
    $RSSFEEDS = array(
    0 => "http://rss.api.ebay.com/ws/rssapi?FeedName=SearchResults&siteId=".$siteid."&output=RSS20&sacat=".MAINCAT."&ftrt=1&fbd=1&sabdlo=".$this->minbid."&sabdhi=".$this->maxbid."&saprclo=".$this->minprice."&saprchi=".$this->maxprice."&floc=1&saslop=1&fsop=$this->sort&fsoo=$this->fsoo&from=R6&fss=".$this->fss."&sasl=".$this->sellerid."&sacur=0&afepn=".CJID."&customid=".$this->sid."&saslc=0&fcl=3&saaff=afepn&catref=C5&frpp=100&satitle=".urlencode($sitewidequery)."+".urlencode($this->q)."&ftrv=1&fts=$srchdesc&".$sitenum."&sascs=".$this->bin."&fspt=".$this->local."&fpos=".$this->zip."&sadis=".$this->miles."&frts=$frts",
    );
    }
    }
    else {
    if ($this->categoryname != ''){
    $RSSFEEDS = array(
    0 => "http://rss.api.ebay.com/ws/rssapi?FeedName=SearchResults&siteId=".$siteid."&output=RSS20&sacat=".$this->catid."&ftrt=1&fbd=1&sabdlo=".$this->minbid."&sabdhi=".$this->maxbid."&saprclo=".$this->minprice."&saprchi=".$this->maxprice."&floc=1&saslop=1&fsop=$this->sort&fsoo=$this->fsoo&from=R6&fss=".$this->fss."&sasl=".$this->sellerid."&sacur=0&afepn=".CJID."&customid=".$this->sid."&saslc=0&fcl=3&saaff=afepn&catref=C5&frpp=100&satitle=".urlencode($sitewidequery)."+".urlencode($this->q)."&ftrv=1&fts=$srchdesc&".$sitenum."&sascs=".$this->bin."&fspt=".$this->local."&fpos=".$this->zip."&sadis=".$this->miles."&frts=$frts",
    );
    } else {
    $RSSFEEDS = array(
    0 => "http://rss.api.ebay.com/ws/rssapi?FeedName=SearchResults&siteId=".$siteid."&output=RSS20&sacat=".MAINCAT."&ftrt=1&fbd=1&sabdlo=".$this->minbid."&sabdhi=".$this->maxbid."&saprclo=".$this->minprice."&saprchi=".$this->maxprice."&floc=1&saslop=1&fsop=$this->sort&fsoo=$this->fsoo&from=R6&fss=".$this->fss."&sasl=".$this->sellerid."&sacur=0&afepn=".CJID."&customid=".$this->sid."&saslc=0&fcl=3&saaff=afepn&catref=C5&frpp=100&satitle=".urlencode($sitewidequery)."+".urlencode($this->q)."&ftrv=1&fts=$srchdesc&".$sitenum."&sascs=".$this->bin."&fspt=".$this->local."&fpos=".$this->zip."&sadis=".$this->miles."&frts=$frts",
    );
    }
    }
  • with:
    if ($cloak == '1'){
    $sitewidequery = str_replace("+", "", $sitewidequery);
    if ($this->categoryname != ''){
    $RSSFEEDS = array(
    0 => "http://desc.shop.ebay.com/i.html?_nkw=".urlencode($front->q)."+".urlencode($sitewidequery)."&_in_kw=1&_ex_kw=&_sacat=".$this->catid."&LH_TitleDesc=$srchdesc&_mPrRngCbx=&_udlo=".$front->minprice."&_udhi=".$front->maxprice."&_okw=&_oexkw=&LH_IncludeSIF=1&LH_BIN=".$front->bin."&_ftrt=901&_ftrv=&_sabdlo=".$front->minbid."&_sabdhi=".$front->maxbid."&_samilow=&_samihi=&_fspt=".$front->local."&_sadis=".$front->miles."&_fpos=".$front->zip."&_fss=".$front->fss."&_sasl=".$front->sellerid."&_fsct=&LH_SALE_CURRENCY=".$siteid."&_sop=$front->sort&_dmd=1&_ipg=100&_rdc=1&_rss=1",
    );
    } else {
    $RSSFEEDS = array(
    0 => "http://desc.shop.ebay.com/i.html?_nkw=".urlencode($front->q)."+".urlencode($sitewidequery)."&_in_kw=1&_ex_kw=&_sacat=".MAINCAT."&LH_TitleDesc=$srchdesc&_mPrRngCbx=&_udlo=".$front->minprice."&_udhi=".$front->maxprice."&_okw=&_oexkw=&LH_IncludeSIF=1&LH_BIN=".$front->bin."&_ftrt=901&_ftrv=&_sabdlo=".$front->minbid."&_sabdhi=".$front->maxbid."&_samilow=&_samihi=&_fspt=".$front->local."&_sadis=".$front->miles."&_fpos=".$front->zip."&_fss=".$front->fss."&_sasl=".$front->sellerid."&_fsct=&LH_SALE_CURRENCY=".$siteid."&_sop=$front->sort&_dmd=1&_ipg=100&_rdc=1&_rss=1",
    );
    }
    }
    else {
    $sitewidequery = str_replace("+", "", $sitewidequery);
    if ($this->categoryname != ''){
    $RSSFEEDS = array(
    0 => "http://desc.shop.ebay.com/i.html?_nkw=".urlencode($front->q)."+".urlencode($sitewidequery)."&_in_kw=1&_ex_kw=&_sacat=".$this->catid."&LH_TitleDesc=$srchdesc&_mPrRngCbx=&_udlo=".$front->minprice."&_udhi=".$front->maxprice."&_okw=&_oexkw=&LH_IncludeSIF=1&LH_BIN=".$front->bin."&_ftrt=901&_ftrv=&_sabdlo=".$front->minbid."&_sabdhi=".$front->maxbid."&_samilow=&_samihi=&_fspt=".$front->local."&_sadis=".$front->miles."&_fpos=".$front->zip."&_fss=".$front->fss."&_sasl=".$front->sellerid."&_fsct=&LH_SALE_CURRENCY=".$siteid."&_sop=$front->sort&_dmd=1&_ipg=100&_rdc=1&_rss=1",
    );
    } else {
    $RSSFEEDS = array(
    0 => "http://desc.shop.ebay.com/i.html?_nkw=".urlencode($front->q)."+".urlencode($sitewidequery)."&_in_kw=1&_ex_kw=&_sacat=".MAINCAT."&LH_TitleDesc=$srchdesc&_mPrRngCbx=&_udlo=".$front->minprice."&_udhi=".$front->maxprice."&_okw=&_oexkw=&LH_IncludeSIF=1&LH_BIN=".$front->bin."&_ftrt=901&_ftrv=&_sabdlo=".$front->minbid."&_sabdhi=".$front->maxbid."&_samilow=&_samihi=&_fspt=".$front->local."&_sadis=".$front->miles."&_fpos=".$front->zip."&_fss=".$front->fss."&_sasl=".$front->sellerid."&_fsct=&LH_SALE_CURRENCY=".$siteid."&_sop=$front->sort&_dmd=1&_ipg=100&_rdc=1&_rss=1",
    );
    }
    }
  • Edit index.php (webroot of store)
  • Replace every occurrence of: href="'.$link.'"
  • with: href="http://rover.ebay.com/rover/1/711-53200-19255-0/1?ff3=4&toolid=10001&campid='.CJID.'&customid=&mpre='.$link.'"

I know it looks like a jumbled mess (which it is) but this is after a long day of deciphering  ebay’s rss codes. I will go over all the options and what they mean in a future post just in case anyone cares.

If you have any questions leave a comment and me or Rich will try to respond as soon as we can.

Thanks

Daniel (syns0r)