X hide

Magento Invitations v1.x Developer's Guide

From Plumrocket Documentation

You are viewing:  Invitations-32.png  Invitations

The getUrlWithInviter function allows you to get a URL with an invite parameter.

Using a URL like this, you can be sure that the users who follow this link to access the site, will be recognized as your invitees by the system. In order to add the invite parameter to any URL, you should add the following data in the end of href parameter:

<?php echo '?inviter='.$this->helper('invitations')->getCurrentCustomerId() ?>

In order to get the URL with invite parameter, you should invoke

<?php $url = Mage::helper('invitations')->getUrlWithInviter($route, $params, $customerId) ?>


The getUrlWithInviter method is similar to the Mage::getUrl method (More details on this method can be found here). The only difference is the third optional parameter $customerId; if it is not indicated, the current user ID will be used automatically.

Below you will find an example to be used in AddThis:

<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style " addthis:url="<?php echo Mage::helper('core/url')->getCurrentUrl()?><?php if ($cId = $this->helper('invitations')->getCurrentCustomerId()) echo '?inviter='.$cId ?>">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_pinterest_pinit"></a>
</div>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=YOUR_PUBID"></script>
<!-- AddThis Button END -->


Below you will find an example how to create сurrent url with invite parameter input:

<input name="current_url" value="<?php echo Mage::helper('core/url')->getCurrentUrl()?><?php if ($cId = $this->helper('invitations')->getCurrentCustomerId()) echo '?inviter='.$cId ?>" />


Below you will find an example how to create custom url with invite parameter input:

<input name="custom_url" value="http://mydomain.com/<?php if ($cId = $this->helper('invitations')->getCurrentCustomerId()) echo '?inviter='.$cId ?>" />


API Reference

Some of the services require additional setup in order to import address books. Please click on the links below to setup your personal API for each service.
Facebook address book configuration Gmail address book configuration Yahoo address book configuration
Facebook API Gmail API Yahoo API

Navigation