Jump to content

Referral Program Adaptation - for facebook


jordanbork

Recommended Posts

I discovered that Prestashop Referrals work without sponsoring your friends, just by having the Referral E-mail filled in at sign-up. I saw this as an opportunity for customers to "share" their referral programs on social media sites, rather than "sponsoring" a few friends.

 

I don't have much experience developing, but I am exceptional at hacking code together (*cringe*) to get exactly what I want. That being said, I can't get away with that in Prestashop. Here is my first attempt at changing how the Log-in page works.

 

themes/default-bootstrap/modules/referralprogram/viewstemplates/hook/authentication.tpl:

<input class="form-control" type="text" size="52" maxlength="128" id="referralprogram" name="referralprogram" />
        <script>
            $(document).ready(function() {
                $('input.referralprogram').val((/(\?|&)sponsor=([^&]*)(&|$)/).exec(window.location.href)[2]);
            });
        </script>

What this script was supposed to do was fill in the referralprogram input with the sponsor url parameter. Presta-kadabra! My script tag doesn't show up in the source. I know it doesn't belong there. Prestashop is forcing me to learn how to develop correctly. This was the first of two steps, the second being to have prestashop share the referral link with the customers' e-mail address, rather than the integrated token.

 

Final notes:

  • Perhaps it would be better to modify the current system, rather than my approach

 

The end result would be an easy way for customers to get referrals through facebook, twitter, etc.

 

Please lend me a hand, I will actively work with anyone today/tomorrow and perhaps get this stickied so Prestashop's referral system is useful with social media!

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...