Jump to content
HostT

Open Source Affiliate Coupons/Promo Code (instead of link)

Recommended Posts

So what does this addon mean? It means your customers can give out promo codes, AND no longer have to use those ugly affiliate links!

 

We all know customers will make sure to use a promo code ... but will they make sure to use your link? No, not always.

 

Enter WHMCS Affiliate Coupons

 

Selection-1002x631-11.png

 

In my opinion this is one of the best and one of my favorite addons -- the original version Affiliate Coupons by Frank Lazslo:

http://forum.whmcs.com/showthread.php?31020-Affiliate-Coupons

 

Unfortunately the addon has not been updated recently (and completely understandable), I decided to go ahead and put it up on my GitHub and start working on it.

 

Latest update should be fully compatible with WHMCS 5.2+

 

So here's what's been updated so far:

  • Updated Affiliate Cookie ID
  • Updated Hook Cookie ID
  • Updated Default Template
  • Updated Client Area HTML/CSS Output

 

Planned Updates:

  • Restructure to only addon module
  • Update admin area configuration, and layout
  • Update templates and output

 

Got an idea? Well post it on GitHub under issues!

 

So what are you waiting on!? It's open source, so check it out on GitHub, and if you're feeling froggy, contribute as well!

 

https://github.com/tripflex/whmcs-affcoupons

 

NOTE: If you're using WHMCS 5.1 you will have to use the branch in link below, 5.2 has changed and the master branch is not compatible with WHMCS 5.1

 

https://github.com/tripflex/whmcs-affcoupons/tree/WHMCS-5.1

Selection-1130x736-12.png

Share this post


Link to post
Share on other sites

Great thank you! I missed the notice on the other thread and just saw this here, so I'll be testing it in the coming days and let you know. many thanks again!

Share this post


Link to post
Share on other sites

Hi there. Please help installing this addon.

After installing it is not visible in client area. After changed affcoupons.php to show errors I get this.

 

Fatal error: Call to undefined function select_query() in /var/www/html/affcoupons.php on line 26

 

Thanks in advance.

Share this post


Link to post
Share on other sites
Hi there. Please help installing this addon.

After installing it is not visible in client area. After changed affcoupons.php to show errors I get this.

 

Fatal error: Call to undefined function select_query() in /var/www/html/affcoupons.php on line 26

 

Thanks in advance.

 

What version of WHMCS are you using? That error is from the select_query() function that is a native WHMCS MySQL query. That error says there is something wrong with your WHMCS installation, it's not related to the addon.

Share this post


Link to post
Share on other sites

Hiya, is this confirmed working with the latest whmcs? I've tried to install, but it seems broken. I renamed the folder to just affcoupons so that it shows up as an addon, but from that point on, it just gives me broken pages.

 

Thanks!

Share this post


Link to post
Share on other sites
Hiya, is this confirmed working with the latest whmcs? I've tried to install, but it seems broken. I renamed the folder to just affcoupons so that it shows up as an addon, but from that point on, it just gives me broken pages.

 

Thanks!

 

Which version, 5.3.5?

 

Did you follow the installation instructions?:

https://github.com/tripflex/whmcs-affcoupons/blob/master/INSTALL

 

Please provide any further details you can so I can try and reproduce the errors

Share this post


Link to post
Share on other sites

I tried a lot of ways but, it is not showing up in the affiliates.php at the bottom? What do i need to put in affiliates.tpl?

Share this post


Link to post
Share on other sites

i am assuming since there is already a default * file in the root, we save that to old and replace it with the one in this module, is that correct?

Share this post


Link to post
Share on other sites

i cant get this to work either, its installed and activated and i added a coupon but it is nowhere to be found other than in the ACP list

 

cannot access https://mysite.com/index.php?m=affcoupons not found

 

 

UPDATE:

 

The promo code page is located here not at the link above..

 

https://yoursite.com/whmcs/index.php?m=affcoupons

Edited by durangod

Share this post


Link to post
Share on other sites

ok folks i totally changed the layout of the promo codes page, everything is centered and i move the alert to the top of the page, to me it looks better.

 

the file name is clientaffcoupons.tpl and it goes in the modules/addons/affcoupons/

make sure you rename your old one to old or save it someplace.

 

here is what it looks like on the client side.

 

affpromsample.jpg

 

and here is the code..

 


<!-- moded version layout, all centered and added widths and colors and css and moved inputs to center page content -->

<!-- added notice style as it was not found in bootstrap -->


<div id="affcoupons-ajax">
      <div class="affnotice">

        <!-- added if notice color to change text color on alert to red -->

         <div id="notice" class="alert alert-{if !$notice_type}success{else}{$notice_type}{/if}" {if $notice} style="color:#cc0b34;"{/if} {if !$notice}style="display: none;"{/if}>{$notice}
         </div>
      </div>

    <div class="page-header">
       <div class="styled_title" align="center">
           <h2>Landing Page</h2>
       </div>
    </div>

   <form method="POST" action="{$index_page}?m=affcoupons" name="landingpage" id="landingpageForm" align="center">
       <input type="hidden" name="cmd" value="modlanding">
       <div class="well textcenter">
           <input type="text" name="landing" id="landing" value="{$landing}" class="bigfield" size="40" maxlength="60" />
             
           <input type="submit" name="Submit" value="Update" class="btn btn-primary btn-large" id="updatelanding" />
           <div class="internalpaadding">
            <p>This option will control where your referrals will be redirected after visiting your referral link.</p>
           </div>
       </div>
   </form>
<div class="page-header">
    <div class="styled_title" align="center" style="padding-top:15px;">
        <h2>Your Coupons</h2>
    </div>
</div>
<table  class="table table-striped table-framed" cellspacing="10" cellpadding="0" style="background-color:#EBEBEB;" align="center">
    <thead>
        <tr>
            <th width="10%" align="center">Delete</th>
            <th width="30%" align="center">Coupon Code</th>
            <th width="20%" align="center">Coupon Type</th>
            <th width="20%" align="center">Coupon Value</th>
            <th width="20%" align="center">Uses</th>
        </tr>
    </thead>

    {if !$coupon}
    <tbody><tr><td colspan="5" style="text-align:center;font-weight:bold;">No Coupons Found</td></tr></tbody>
    {else}
      <tbody>
       {foreach from=$coupon key=k item=v}
	<tr>
	<td width="10%" align="center">
	<a href="{$index_page}?m=affcoupons&cmd=del&cid={$v.id}"><img src="modules/addons/affcoupons/inc/images/delete.png" alt="Delete"></a>
	</td>
	<td width="30%" align="center">{$v.code}</td>
	<td width="20%" align="center">{$v.type}</td>
	<td width="20%" align="center">{$v.value}</td>
	<td width="20%" align="center">{$v.uses}</td> 
	</tr>
       {/foreach}
     </tbody>
    {/if}

</table>
<div class="page-header">
    <div class="styled_title" align="center" style="padding-top:15px;">
        <h2>Add Coupons</h2>
    </div>
</div>

<form action="{$index_page}?m=affcoupons" method="POST" name="addcoupons" class="form-horizontal">
    <input type="hidden" name="cmd" value="add" />
    <div class="well" align="center">

<!-- modified so that it is in one control group and one class controls css (side by side) and added bkground color -->

        <div class="control-group">
                <div class="controls">
                <label for="code" class="control-label">Coupon Code:</label>
                <input type="text" name="code" id="code" />       
                <label for="code" class="control-label" style="padding-left:10px;">Coupon Type:</label>
                <select name="type">
		{foreach from=$avail_coupon item=v}
		<option value="{$v.enc_string}">{$v.label}</option>
		{/foreach}
                </select>
                         <input type="submit" name="Submit" value="Add" class="btn btn-primary btn-large" />
            </div>  <!-- close controls -->
        </div> <!-- close group -->
     	    </div>  <!-- close well -->
</form>
</div> <!-- close div affcoupons-ajax -->
<br />
<br />
<!-- end affcoupons-ajax -->


 

enjoy :)

 

ps - one simple note to developer make sure your closeing your input tags with / and i dont know what template you used for your demo image on the first post but it dont look nothing like mine at all...

 

questions:

 

as admin how do i know what coupon codes are valid, once the client assigns a code it should be shown in the ACP someplace but it is not. So how do i know what is valid and what is not as an admin.

 

And do these codes go in the promo input on the cart page?

 

I dont need to print or design anything like a flyer, that is all for the affiliates to do? I am guessing thats how this works, they hand out a flyer with the code and then that person uses the code to get the discount. Correct?

 

and i guess ill be adding a menu link or some kind of link to https://yoursite.com/whmcs/index.php?m=affcoupons because it is not showing up on the affiliate page and i thought you said it would be there.

 

and also please tell me what this is i the image. if this is just a sample, how do i get rid of it i dont like samples on my site. What is planned here?

 

exampsb.jpg

 

thats all questions for now thanks.

 

thanks :)

Edited by durangod

Share this post


Link to post
Share on other sites

here is another change...

 

Issue: setting the type to Percentage still show for example 20.00 under coupon value..

 

Fix.. toss in an if statement to change the display accordingly.

 

here is the new code snippet for inside of modules/addons/affcoupons/clientaffcoupons.tpl

 

original code

 

<td>{$v.value}</td> 

 

i changed to this (this is my version with the width and align - you dont have to use those i just did it thats all

 


//basic version 

               {if $v.type == "Percentage"}
               <td>{$v.value|string_format:"%d"}</td> 
               {else}
               <td>{$v.value}</td> 
               {/if}



// or fancy version

               {if $v.type == "Percentage"}
               <td width="20%" align="center">{$v.value|string_format:"%d"}</td> 
               {else}
               <td width="20%" align="center">{$v.value}</td> 
               {/if}


 

so that will show lets say 20 if percentage and 20.00 if not..

Share this post


Link to post
Share on other sites

Seems to me your going to have to do some serious css mods or have someone do them for you. Im not sure where the dev got his screen shot on the first page. Maybe he also uses a custom theme im not that familiar with all the other themes, i just use portal. But i still believe your going to have to do some big changes to the tpl file to get that look.

Share this post


Link to post
Share on other sites

I dont get why it looks normal with no edits before adding or deleting a coupon. Its a custom theme with no edits and it looks perfect.

Share this post


Link to post
Share on other sites

hi,

 

first please update your thread in the add on section or maybe list both if you can.

 

but i found an issue. Seems like its a battle between your addon and the SEO addon, i made a post there as well.

 

http://forum.whmcs.com/showthread.php?47572-FREE-ADDON-WHMCS-SEO-Page-Manager/page3

 

 

when i went to try to get this to pass w3c it told me that my meta did not belong so i looked and i understand why now

 

this is what it showed i source.

 

 

<script type="text/javascript" src="https://xxxxxxx.com/billing/modules/addons/affcoupons/inc/js/affiliates.js"></script><input type="hidden" id="index_page" value="index.php"/><input type="hidden" id="script_name" value="/billing/index.php"/>

<meta name="description" content="The Portal home page has an assortment of hosting options and features for clients and non clients of DDH. Order your domain, become and affiliate, check network, submit tickets, check announcements and many more features. " />

<meta name="keywords" content="Members Area, Members Home, Portal Home, DDH Portal, DDH Client Area, Hosting Home Page, hosting" />

 

</head>

 

 

i dont know why the meta ended up below your js but it needs to be above, again i left them a post as well.

 

also i think those hidden inputs are yours and they dont belong in the header without an object assignment of some kind. They need to be either in the hook or somehow inside the parsed body section.

 

also i had to add type="text/javascript" to your modules file to get rid of that issue and also had to close a few inputs with / as well in your modules files.

 

is there any way we can get those inputs out of the head section and into the body, and is there any way you can move your js after the meta section so they dont conflict.

 

thanks :)

Share this post


Link to post
Share on other sites

you probably need to redo this section in your clientarea php file

 


} else {
$return_html = '<script type="text/javascript" src="' . AC_WHMCSe::get_module_url( 'affcoupons' ) . '/inc/js/affiliates.js"></script>';
$return_html .= '<input type="hidden" id="index_page" value="' . parent::$index_page . '"/>';
$return_html .= '<input type="hidden" id="script_name" value="' . $vars['SCRIPT_NAME'] . '"/>';
      }

 

 

especially the last two lines which put inputs in the header and they dont belong there. I would suggest possibly converting those to js and just using innerHTML and getElementById to load the values. If you cant do that i think i remember seeing a .loadafter function someplace that you can load stuff like that after the initial body container which is just as good.

 

 

yeah its called insertafter and you have it in your affiliates.js file

 

if (checkAffHeader || checkAffPath == '/affiliates.php' || script_name == '/affiliates.php') {
       $('<div>').load( '/' + index_page + '?m=affcoupons #affcoupons-ajax').insertAfter('.whmcscontainer .contentpadded .pagination');

 

 

just use the same function and load the inputs after the header is loaded.

 

if you need help let us know.

Edited by durangod

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Similar Content

    • By ModulesGarden
      1. WHMCS V7.8 Beta – Modules Compatibility

      It is a pleasure to let you guys know that we are ready for the V7.8 edition of your favorite web hosting management and billing software!

      Our Product Development Team will spare no effort to ensure that every single WHMCS module up for
      grabs on our Marketplace has been thoroughly tested in terms of a tip-top integration with this freshest WHMCS version. Even though the system is still in the beta stage, we managed to roll out several updates already. And still counting!
      Amazon EC2 For WHMCS - v1.1.0 DigitalOcean Droplets For WHMCS - v1.3.1 DirectAdmin Licenses For WHMCS - v1.1.5 EURid Registrar For WHMCS - v1.2.3 Password Manager For WHMCS - v2.2.7 Quotes Automation For WHMCS – v2.0.4 Report Generator For WHMCS - v4.0.1 Unban Center For WHMCS - v2.2.1 Zimbra Email For WHMCS - v1.5.3 Keep an eye on more compatibility labels coming soon!


      2. Netcetera Case Study - EasyDCIM

      While focused on growth, companies tend to overlook the impact their actions may have on the environment around. Data centers, for example, consume a lot of energy and most probably this trend will not shift any time soon.

      But does it have to be that way? EasyDCIM carried out an in-depth case study of a certain company that provides 100% carbon neutral hosting solutions without losing a bit on the service quality.

      Tread the same path to maximum business optimization!


      3. DirectAdmin software 15% OFF

      What do you love summertime for the most? We personally enjoy the chance to pamper our clients with ever hotter deals. And here is one to keep you warm throughout the entire August!
      Choose between our standalone modules for WHMCS integrated with DirectAdmin and save 15% on every single item picked with the code: 15%DirectAdmin Got a taste for more individualized software? Get in touch and have your dream solution for DirectAdmin developed at -15% of the price too! Make summer all about new business opportunities!


      Need Custom Software Development For Your Business?
      Get Your Free Quote Now! Specially for you we will adapt an application and its design to your own needs, create a new module or even a completely new system built from scratch!
    • By ModulesGarden
      1. GoGetSSL For WHMCS - NEW
      Welcome another trailblazing and FREE software in the ranks of our modules - GoGetSSL For WHMCS!
      With this functional tool you will be enabled to supply fully configurable SSL certificates to your clientele and do this all right inside your WHMCS! You will be offered the capability to create new certificates as well as perform all basic operations on the already existing ones (terminating, renewing or modifying). 
      As for your audience, they too will be given all features needed to order new certificates with specific properties and later on view their details in your client area. 
      Download the module from our website with a few simple clicks!
       
      2. SMS Center For WHMCS 3.4.0
      A pleasure to announce that this customer-centered module has been featured with rock-solid support for as many as four new SMS gateways!
      The extra choice you have been given is that of: Hajana One, MEDIA SAT, SMSpubli, plus SMSAPI.pl. This makes the official list of available SMS gateways to include 29 providers in total. Additionally, you are welcome to sign up  to the SMSAPI.pl provider and receive on preferential terms an exclusive bonus from ModulesGarden. 
      Learn more about SMS Center For WHMCS 3.4.0!
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
      Still missing your favorite SMS gateway in the module? We can change that! Order SMS Center For WHMCS through our website, open a ticket with the details and we will develop your dream integration for free. Simple as that! 
       
      3. Unban Center For WHMCS 2.2.0
      This update empowers your clients to unban any IP addresses blocked through Imunify360 from their cPanel directly. Also, they will now be informed via email about each IP address automatically unbanned after logging in to the WHMCS client area.
      Learn more about Unban Center For WHMCS 2.2.0!
       
      4. EasyDCIM Dedicated Servers For WHMCS 1.6.0
      The 1.6.0 release opens up for you and your audience a set of new possibilities. Find among them: graph presenting total traffic from all of the client’s devices, support for "Blade" server model, plus useful information in WHMCS client area on most crucial server details including current operating system and its status. There is more!
      Learn all about EasyDCIM Dedicated Servers For WHMCS 1.6.0!
       
      4. 20% Off Open Source Software
      Recently we launched a one-off promotion on all new open source modules for WHMCS. Now we are extending it to license upgrades as well!
      Do you already own an annual license of our modules and would like to perform a quick upgrade to the open source version? You can do it easily on your own, with just a few clicks! Plus, the newly generated invoice will already contain all discounts applicable, including the exclusive 20% price cut.
      Switch into the unencrypted software for 20% less!
       
      5. 15% Off DirectAdmin Software
      Looking for a reliable web hosting control panel in some reasonable pricing? Be sure to profit from our summer promotion on all kinds of software tools aimed at DirectAdmin!
      The time-limited 15% discount applies to:
       

      All custom projects and services dedicated to DirectAdmin Two modules integrating the DirectAdmin control panel with WHMCS: DirectAdmin Extended For WHMCS and DirectAdmin Licenses For WHMCS All modules equipped with DirectAdmin support: DNS Manager For WHMCS, Advanced Billing For WHMCS, IP Manager For WHMCS, WordPress Manager For WHMCS and many more

      Preview the full list of discounted items!
       
      6.  Account Synchronization For WHMCS – Your Thoughts
      Are there any current or potential users of our Account Synchronization For WHMCS module here? 
      We have just created a brief survey to pick your brains on its features – which ones bring you the biggest benefits and which could be replaced or modified for greater utility. 
      Help us create the software of your dreams!
       
      7. Explore also our other recent releases:

      Product Cross-Selling For WHMCS - NEW Domains Reseller For WHMCS - v2.0.2 Password Manager For WHMCS - v2.2.6 Quotes Automation For WHMCS - v2.0.3 Zendesk For WHMCS - v2.1.3


      Need Custom Software Development For Your Business?
      Get Your Free Quote Now!
      Specially for you we will adapt an application and its design to your own needs, create a new module or even a completely new system built from scratch!
    • By ModulesGarden
      Summer greetings from the ModulesGarden team! 
      We would like to invite you to our energizing promotion dedicated to all modules and custom projects related to DirectAdmin!

      Join now and get 15% off your bespoke software plus such popular modules supporting DirectAdmin as:
      - DirectAdmin Extended For WHMCS
      - DirectAdmin Licenses For WHMCS
      - DNS Manager For WHMCS
      - WordPress Manager For WHMCS
      - Advanced Billing For WHMCS

      Cannot wait to view the full list and grasp this amazing opportunity?
      Leap into our Blog article: https://www.blog.modulesgarden.com/directadmin-summer-promotion
    • By HarryAdney
      Hi guys,
      Quick question, when testing out an affiliate link the page redirects straight to my home page, i.e. clicking on https://domain.com/*?aff=1 redirects straight to https://domain.com. Is this correct?
      Cheers,
       
      Martin
    • By ModulesGarden
      1. May Promotion
      Let us start today’s news with something that everyone loves the most – discounts! 
      This time we would like to offer you one deal in particular – enormous 20% price cut on both annual licenses and open source products for WHMCS, cPanel, Blesta and more. 
      Grab the promo code and use it well before 1st June!
       
      2. Hetzner VPS For WHMCS
      Excited about the idea of supplying Hetzner virtual machines to your audience from WHMCS directly, and in a completely automated manner? Who wouldn’t be, especially now that such a convenient solution is perfectly within your reach! 
      After ordering a machine most suited to their needs, your clients will be able to control its status, rebuild it with selected OS distribution, plus access remote console and much more.  
      For the specifics you should definitely visit the product’s dedicated page. 
      Learn more about Hetzner VPS For WHMCS!
       
      3. GoDaddy Domain Registrar For WHMCS 3.3.0 - in this module update we added the possibility to choose between two alternative ways of activating the registrar. You can use either GoDaddy's dedicated reseller account or a normal user account, depending on you personal preferences. 
      Learn more about GoDaddy Domain Registrar For WHMCS 3.3.0!
       
      4. MetricsCube Update
      MetricsCube is an undoubted leader in the field of professional business analysis. 
      And recently, a hefty update of this tool was pushed to live, supplying company owners with some extra tools. Most importantly, you have been offered the possibility to export desired reports to PDF, CSV and XLS files, choose between two novel LTV reports, and get the application ready for use even faster than before! 
      Check the release notes and get a 14-day free trial!
       
      5. Be sure to explore the list of our latest releases!  

      Client Area Popup For WHMCS - v1.2.2 cPanel Extended For WHMCS - v3.5.1 CRM For WHMCS - v2.5.4 DirectAdmin Extended For WHMCS - v3.1.2 Domains Reseller For WHMCS - v2.0.1 IP Manager For WHMCS - v2.5.3 Plesk Key Administrator For WHMCS - v1.3.1 Support Tickets Allocator For WHMCS - v1.3.1 Virtuozzo VPS For WHMCS - v1.4.1 WordPress Manager For WHMCS - v1.3.2 Zendesk For WHMCS - v2.1.2 Zimbra Email For WHMCS - v1.5.2


      Need Custom Software Development For Your Business?

      Get Your Free Quote Now! Specially for you we will adapt an application and its design to your own needs, create a new module or even a completely new system built from scratch!
  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated