Affiliate Cookie

  • Posts: 108
  • Thank you received: 2
13 years 4 months ago #19978

Hello everyone.
I wish to make the affiliate program a bit more complex.
i would like the affiliate cookie to be set not in my current HikaShop website, I want the cookie to be set when an affiliate redirect someone to a page redirecting to the to the shop.

Means guest comes to an affiliate web site >> linked to a bridge website (an HikaShop cookie is set) >> linked to hikashop store.

I have searched a while for the cookie creation in the HikaShop and couldnt find it, i can set the cookie far back at a different web site or set a cookie and then search for that cookie in the HikaShop.

First option sounds better, so my question is wher can i find the name of the cookie and the definition?

Thanks in advance!

Please Log in or Create an account to join the conversation.

  • Posts: 82823
  • Thank you received: 13370
  • MODERATOR
13 years 4 months ago #19996

Hi,

You cannot set a cookie for another website than yours. That's restricted by the browsers to avoid any session hijacking or other hacks. So I'm afraid you won't be able to do that with php in the code of the bridge website.
The code generating the cookie is in the file plugins/system/hikashopaffiliate.php

What I would do if I were you would be to have an iframe of 1px*1px displaying a page on the hikashop store website on the bridge website with the partner_id included. That would enable the system to set the cookie for the store while the user would be displaying the bridge website.

Please Log in or Create an account to join the conversation.

  • Posts: 108
  • Thank you received: 2
13 years 4 months ago #19999

Ok i understand the restriction.
And thank you for the code i needed the decoder.
Your idea is great, I have just installed it on the bride website but as far as i know i need to iframe with the partner_id which is at the bridge site the iframe is in. so im asking do i have to use JS or something to implant the partner_id to the iframe or can it work differently?

Please Log in or Create an account to join the conversation.

  • Posts: 82823
  • Thank you received: 13370
  • MODERATOR
13 years 4 months ago #20001

For example, you could use a custom code module extensions.joomla.org/extensions/edition...code-in-modules/3668

And then, suppose that you give URLs like mybridge.com/index.php?partner_id=56 to your affiliates, you could put something like that:

echo '<iframe src=" mystore.com/index.php?partner_id='.$_GET .'" height="1px" width="1px"></iframe>';

Please Log in or Create an account to join the conversation.

  • Posts: 108
  • Thank you received: 2
13 years 4 months ago #20004

Perfect!
Work exactly as i need it.
Thank you again :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.060 seconds
Powered by Kunena Forum