Custom Parameters

Why?

Magento can be set up in different ways, and to support this we allow setting of key Fanplayr parameters through Javascript.

This must be set before the main Fanplayr script is called, so it's good to add this to the head of your site. A simple place to add this is System > Configuration > Design > HTML Head > Miscellaneous Scripts.

(function(w) {

  // make sure that both "fanplayr" and the "fanplayr.custom" objects exists
  w.fanplayr = w.fanplayr || { _i:[] };
  var customParmeters = w.fanplayr.custom = w.fanplayr.custom || {};

  // Examples of custom parameters

  // In this first example we are running on a single store that we want to treat as
  // two different stores by settting "fake" domains
  var tld = 'en';
  if ( window.location.indexOf('/de/') ) {
    tld = 'de';
  } else if ( window.location.indexOf('/fr/') ) {
    tld = 'fr';
  }

  // this is the URL that is used for calling the Fanplayr controller
  customParmeters.embedUrl = '//mystore.com/index.php/';

  // set the domain which Fanplayr tracks as to either "mystore.en", "mystore.de" or "mystore.fr"
  customParmeters.storeDomain = 'mystore.' + tld;

  // Customizing the Apply To Cart and deputization URLs
  // here we need to use the "tld" as our store has been set up with different languages
  // in different directories and we don't want to take the user to our "default" language
  customParmeters.applyToCartUrl = '//mystore.com/' + tld +  '/custom_apply_url';
  customParmeters.deputizeUrl = '//mystore.com/' + tld +  '/custom_deputize_url';

}(window));

Parameter details

storeDomain

The domain that Fanplayr links to the campaign domain. An example of using this is to have different campaigns, on the same account, running on a single store for different languages.

embedUrl

The URL that is used to call the Fanplayr controller. For example, if you set it to "//mystore.com/index.php/" the controller will be called as ""//mystore.com/index.php/fanplayr/";

accountKey

The Account Key that this store is linked to. Through store configuration you can only link to a single account. If you need to link to more, set this to the Account Key needed.

applyToCartUrl

Can be used to override the Apply To Cart URL. This may be needed when you use multiple store domains, especially to keep a user in the same language or region of your site.

deputizeUrl

Can be used to override the Deputize URL. This is generally not needed, except in circumstances where user sessions are stored on a Website, Store or Store View only basis.

results matching ""

    No results matching ""