Jump to content
Sign in to follow this  
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.
Sign in to follow this  

  • Similar Content

    • By ModulesGarden
      1. Black Week Cyber Sale – 21% OFF everything!

      The end of our whopping Black Week Cyber Sale is getting dangerously close! Don’t postpone satisfying the cravings for your ideal software gear, and pick up every single module with a handsome 21% discount that remains up for grabs until December 3rd.

      The offer not only includes open source products and license upgrades, but also extends so far as to cover even the most recent additions to our Marketplace:
      Freshservice For WHMCS - allow the comfort of using Freshservice tools without leaving your client area while your support teams manage all WHMCS tickets directly in Freshservice. Virtuozzo Hybrid Infrastructure S3 For WHMCS - automatically supply and control VHI S3 user accounts with previously specified limits of operations, bandwidth and the total usage of storage. Vultr VPS For WHMCS - handle the provisioning of Vultr servers automatically, allow clients to adjust the machine details, enter the console and perform other actions remotely.
      Embrace the hefty savings with our Black Week Cyber Sale!



      2. Products Reseller For WHMCS 1.4.0

      If you are developing your own reselling business, but don’t really know how to effectively spread your wings, our brand-new Products Reseller For WHMCS 1.4.0 comes to the rescue!

      Besides adding new API options, we have also implemented quite a few nifty features that will make using our module even more versatile. More specifically, this brand-new 1.4.0 update marks the official premiere of Softaculous Virtualizor integration! With your resellers empowered to include Virtualizor servers as part of their offerings, Products Reseller For WHMCS will bring you one step closer to gaining worldwide recognition!

      Reach a turning point in your career with Products Reseller For WHMCS 1.4.0!



      3. The status of being updated most recently also belongs to:
      Advanced Billing For WHMCS - v3.7.2 GoGetSSL For WHMCS - v2.6.4 Multibrand For WHMCS - v2.9.1 with WHMCS V8.3 support [HOT!] OpenStack VPS & Cloud For WHMCS - v2.0.5 Report Generator For WHMCS - v4.2.1

      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
      Good day folks!

      For everyone whose mind was boggling over the upcoming Black Friday event, we’ve got even more thrilling news.

      A week-long shopping festival has just kicked off, empowering you to pick up each and every product from our Marketplace
      at a huge 21% discount – open source and license upgrades count as well!



      Keep in mind that our Black Week Cyber Sale finishes on December 3rd. Don’t overlook the chance and grab as many modules as you only crave!

      Drop by for groundbreaking bargains!
    • By ModulesGarden
      1. ModulesGarden 10th Anniversary - Last Call!

      Nothing has ever given us more joy and satisfaction than celebrating the goal of achieving a decade of professional experience, but, as they say, all good things must come to an end. We are slowly closing on our exciting 10th Anniversary Promotion!

      Hurry along to get your hands on discounts reaching 50% before they disappear once and for all at the end of this Sunday!

      Get involved in the anniversary festivities!



      2. Vultr VPS For WHMCS - NEW!

      Have you noticed that our Marketplace grew substantially bigger? It's all thanks to our brand-new Vultr VPS For WHMCS allowing you to smoothly provision and remotely manage Vultr virtual machines.

      With this high-standard product, your clients will easily order the servers tailored to their requirements, and afterwards carry out all kinds of management operations over their machines from within one place - your WHMCS system.

      Look for more exciting details, including a huge 20% Deal Of The Week discount, directly on our website!

      Learn more about Vultr VPS For WHMCS!



      3. Virtuozzo Hybrid Infrastructure S3 For WHMCS - NEW!

      We are even more thrilled to announce that Vultr VPS For WHMCS is not the only new addition to our vast collection of provisioning modules - another recently developed module we take the pleasure in presenting you today is Virtuozzo Hybrid Infrastructure S3 For WHMCS!

      How would you like the power to handle different limits for VHI S3 user accounts as well as combine the module with our well-known Advanced Billing For WHMCS? Get more information on our website, and grab it now at a 33% discounted rate to feel the advantage!

      Learn more about Virtuozzo Hybrid Infrastructure S3 For WHMCS!



      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. ModulesGarden 10th Anniversary - Save up to 50%!

      It is with immense pride and more pleasure than ever that we spread this smashing news: ModulesGarden now boasts a decade of professional activity… and still going strong!

      We would like to thank wholeheartedly the entire WHMCS community for being an infinite source of inspiration and support during all these 10 years - we would never have accomplished this much if it wasn’t for our dearest customers!

      On this exceptional occasion, let us invite you to one of the biggest promotions ever launched at ModulesGarden. We have arranged two generous discounts allowing you to pay even 50% less for all modules offered at our Marketplace - head over to our Blog and learn all the necessary details!

      Let’s get this party rolling!



      2. WordPress Manager For WHMCS 1.7.0

      Supplied with tons of fresh energy to continue our hard work, let us announce the hottest release that November has brought so far: WordPress Manager For WHMCS 1.7.0!

      We have added a pack of excellent new features to help you see to the wants of your audience even more effectively. Let’s go straight to the details: Extended View - your clients are now given a choice between a classic list and a brand-new view with screen thumbnails and action tools for the management of their WordPress instances. Website Details - the scope of remotely accessible data has been extended to cover Google "PageSpeed Insights" statistics. Maintenance Mode - ensures the safety of instance conservation by allowing clients to temporarily close their websites. Users Management - WordPress user accounts with specified permission roles can be now created and viewed without leaving your client area. Give your business a cutting edge with WordPress Manager For WHMCS 1.7.0!



      3. MetricsCube MRR Breakdown for WHMCS

      Considering that nearly every web hosting service comes as a subscription-based offering, one would assume that all businesses are perfectly aware of how important the habitual MRR analysis is. Sadly, the reality is much different. So, which group do you fall into?

      There is a brand-new piece of reading on the MetricsCube Blog showing how MRR Breakdown can help you fill in all the gaps in understanding Monthly Recurring Revenue. Learn from the MetricsCube Founder himself how to scale your MRR figures up and watch an essential video guide through every nook and cranny of MRR Breakdown.

      Attain your business goals through educated choices!



      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
      Hop into the celebration of ModulesGarden’s 10th Anniversary!
      There are some particularly majestic points in business paths of all sorts that rightly deserve the extra special kind of attention. For the entire ModulesGarden family right now it is for sure reaching the milestone of the 10th Anniversary! It has been an enormous privilege to serve your needs in a myriad of ways, and develop exponentially alongside you for this past decade.

      In our Blog, we invite you to see with your own eyes how much we have grown surrounded with your enthusiastic support. And to make the ongoing celebrations even more memorable, we have arranged two kinds of exclusive offers that you are most welcome to take full advantage of!
       
      Join the festivities and save up to 50%!
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

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