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 Utixo Cloud Services
      Boost you business growth with the best affiliate tool.
      This module logic is to assign each client an account manager(agent) who can help him with commercial and technical issues and is the first point of contact for the client.
      The agent will earn commission on all the client’s orders. Contact details for the agent are displayed on the client’s dashboard, effectively making the agent the client’s dedicated reference for sales/technical support.
      More info here:
      https://utixo.net/en/affiliate-management/
      Updated to support all latest versions.
    • By ModulesGarden
      1. Summer Sale - Last call for 25% OFF!

      We'd have wanted our Summer Sale to live long and happily ever after, but - unfortunately - that cannot happen. That is why we leave it in your capable hands to squeeze as much as possible from the markdowns before June ends!

      A whopping 25% discount for whatever your hearts longs for: an annual module, open source or license upgrade - that is a a great deal, and no one can deny it. But the best part is - you can save even more!

      Master all the saving tricks behind our Summer Sale!



      2. WordPress Manager For WHMCS 1.6.0

      Whenever you visit the official page of WordPress Manager For WHMCS, you can be sure that some thrilling novelties are there, waiting for you. This time things are no different as we have just released the jaw-dropping 1.6.0 version that makes this piece of software twice as much noteworthy, and all because of:
      WHMCS V8.2 support that now includes full-scale integration with "Twenty-One" system theme The possibility to choose whether the automatically installed WordPress installations can be deleted by your clients or not The newly added "Default Theme" option which will let you pick the WordPress templates that shall be enabled after installation Shortcuts that allow single sign-on into WordPress admin panel from a couple of client area locations The permission for your clients to decide if the "Auto Upgrade" feature should be applicable to both "Major" and "Minor" versions of WordPress, or just the latter Useful notes that your clients can freely add during the process of instance backup If you seek more information about this or any of the remaining utilities, the tour begins at the changelog!

      Claim all the new powers of WordPress Manager For WHMCS 1.6.0!



      3. MetricsCube MRR Breakdown - A whole new dimension of income insight!

      Our friends at MetricsCube have brought a new king of income calculation - MRR Breakdown! It is a premium reporting section giving you a thorough understanding of your Monthly Recurring Revenue that comes in particularly handy if you have a subscription-based business.

      While you look into this quality-packed update, be sure not to forget to tap into the extra potential lying in the just introduced Annual Recurring Revenue and Paying Customer Lifetime Value reports.

      Enter the level of MRR insight you wouldn't think is possible!



      4. Study the list of other modules that also received some fine-tuning during the course of last week:
      Cancellation Center For WHMCS - v1.4.12 DigitalOcean Droplets For WHMCS - v1.6.5 Discount Center For WHMCS - v1.4.12 Freshdesk For WHMCS - v1.3.6 GoDaddy Domain Registrar For WHMCS - v3.3.9 G Suite For WHMCS - v1.3.6 QuickBooks Desktop For WHMCS - v1.4.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
      1. Summer Sale – 25% OFF EVERYTHING!

      How to better celebrate the arrival of Summer if not with a thrilling shopping spree? Our Summer Sale is here to kit you out with the best WHMCS modules at the absolute best prices!

      From now through 30th June, ModulesGarden is knocking down the prices of every single WHMCS product to be spotted on the Marketplace. So go ahead, grab a jaw-dropping 25% promo code and use it however you like – with annual licenses, open source modules, even license upgrades!

      Tip: you can put away much more by bulk ordering and mixing the Summer Sale with other tremendous offers.

      Snap up the easiest summer savings of your life!



      2. Products Reseller For WHMCS v1.2.0

      How to make your resellers fully satisfied with your cooperation?

      If you run a reselling business, this is the kind of a question that you most likely googled at least once before. While the answers are plenty, it may be quite a tough nut to crack to sift through the maze of suggestions, and find those that may actually help you.

      Luckily, our vastly updated Products Reseller For WHMCS is here to offer you all the tools you wish you’d have to make sure the needs of your resellers are perfectly catered for. And these are the major new features built into the module throughout the works on the 1.2.0 version:
      Flawless support has been introduced for WHMCS V8.2 that extends to the modern "Twenty-One" template. Your products can be now marketed by resellers with the support of WHMCS "Configurable Options", each of which can be priced individually. End clients have been empowered to use the synchronized product custom fields with your services. The range of products available for reselling can be now further extended to include such in-demand offerings as EasyDCIM dedicated servers and OpenStack projects.
      Products Reseller For WHMCS 1.2.0 will help you forge enviable bonds with your resellers!



      3. The following updates have also been made available since last week:
      Amazon EC2 For WHMCS 1.3.2 DNS Manager For WHMCS 2.16.0 Plesk Extended For WHMCS 3.5.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
      1. WordPress Manager For WHMCS 1.5.5 - 18% OFF

      18 years have passed since the world saw WordPress for the first time. So much has changed over time, hasn’t it? The platform has grown into a world-leader of blogging and website creation. Can you believe that 40% of all existing websites are powered by WordPress?

      All the more we are thrilled to bits to announce that our best-selling WordPress Manager For WHMCS has embraced the flawless compatibility with WHMCS V8.2 on account of its most recent 1.5.5 update!

      Give the fine-tuned WordPress Manager For WHMCS a closer check!

      And since the celebration of the WordPress 18th birthday goes on, it is only to be expected that we want to throw our own big fiesta as well! Hop into a champagne mood and treat yourself to the festive 18% promo code on WordPress Manager For WHMCS that is up for grabs on our website for a limited time only!

      Join the party and grab your discount gift!



      2. OpenStack Projects For WHMCS 1.1.0

      To help you stay ahead of the competition with your provisioning venture, we have rolled out a must-see 1.1.0 update of our popular OpenStack Projects For WHMCS module!

      Together with the newly secured support for WHMCS V8.2, the product has also embraced several other enhancements:
      Determine the pricing for the OS images via WHMCS "Metric Billing" Use the "Metric Billing" solution for the usage of storage volumes Establish the limits of compute quota for the OpenStack’s "Traits" and Virtuozzo’s "Placement Groups" by means of configurable options Would you like to get a broader perspective on the module’s new components?

      Explore the full changelog of OpenStack Projects For WHMCS 1.1.0!



      3. Below are the modules which have also earned the label of WHMCS V8.2 support as of late:
      cPanel Extended For WHMCS - v3.12.1 Domain & Email Forwarding For WHMCS - v1.4.0 Proxmox Cloud VPS For WHMCS - v3.1.1 Proxmox VPS For WHMCS - v3.1.1 Support Tickets Allocator For WHMCS - v1.3.5 Unban Center For WHMCS - v2.3.4 Zimbra Email For WHMCS - v2.1.5

      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.

×
×
  • 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