-- HikaShop version -- : 2.2.2 Business
-- Joomla version -- : 2.5.14
-- PHP version -- : 5.24
Hello!
I'd like to give partners of my store option to place referral link (banner) in their websites, that would contain partner name as parameter - so when client clicks banner in our partner's site, he would get 10% discount upon placing order in our shop. So link in banner would be something like:
domain.com/shop/register
?refferal=banner01
Newly registred client would receive discount for his next order.
As there is no feature now, I made small JavaScript, that parses referral link searching for referral keyword and it's value. If referral is found, it's value is stored in temporary cookie. And when customer gets to step in Hikashop order procedure, when there is discount field, this script finds coupon field, fills it with coressponding referral, and updates discount.
If somebody is interested in this temporary solution I wrote, please download attached JavaScript fragment (jQuery 1.9 or newer required) and add to the end of Your existing template javascript. What this script does is - it search for parameter
in link that points to Your shop, it makes temporary cookie to store this referral, and than upon placing order it automatically enters "name" as coupon.
For example:
- You create banner with link "
yourshop.com
?referral=partnersite.com"
- You create HikaShop coupon "partnersite.com" with, lets say, 10% discount
- When customer clicks on banner above he gets to Your site, places order, and automatically have one-time 10% discount
I hope that this funcionality will be included in HikaShop future versions, but until than - I hope that maybe someone else will find this code useful.