eMoneySpace
Welcome, Guest. Please login or register.
Did you miss your activation email?
News: Earn your money online safely here at eMoneySpace. Aug 19, 2022 05:26 am




FREE Buy One Get X Free Mod
Print
Author Topic: FREE Buy One Get X Free Mod  (Read 3399 times)
757jterrell
Reputation: (+29)
*

Offline

Gender: Male
Posts: 967
Referrals: 0


Get a site from the OWNERS of the script!!!

View Profile WWW
Apr 26, 2010 07:25 pm

This is an excellent tool that we thought all site owners should have.  This will work on all auroras and will help with sales. Now, before we go into the details of how you install it, someone at made wrong has accused us of stealing this mod. So lets put that completely to rest first.

Yes, I did contract with latin clicks to make this mod.  I had tons of clients asking for it to be included in our script, so it just made sense to do it.  Here is the conversation:


jterrell72000 (4/14/2010 8:47:03 PM): did you have the buy one get x free mod?
§MoLtEn (4/14/2010 8:47:23 PM): no i don't have it .. but i think it's very fast to do ..
jterrell72000 (4/14/2010 8:47:42 PM): well consider it a project for you
jterrell72000 (4/14/2010 8:48:16 PM): just so you know, I am going to post it free on ems, so just understand that lol
§MoLtEn (4/14/2010 8:48:34 PM):
jterrell72000 (4/14/2010 8:48:35 PM): we will give you $XX for it (I MODIFIED THE PRICE)
jterrell72000 (4/14/2010 8:49:51 PM): money sent, let me know if you wanted that project
§MoLtEn (4/14/2010 8:56:56 PM): ok


Now, here is what was provided by latin clicks: (actual email can be forwarded to a mod if requested)
Code:
************************************************************
Luis Edgar Rivera Chávez <edgar_luis@hotmail.com>
Friday, April 23, 2010 12:03 PM
jterrell7@cox.net <jterrell7@cox.net>
buy 1 get X free Add-on

easy to install ...


u can replace the 2 files


OR

place in line 50 at /admin2/settings/member.php


line 50 aprox 

$settings["purchase_bonus"]        =    "$purchase_bonus";


line 82 aprox

   <tr>
        <td width=\"250\"><b>Special Purchase Bonus: </b>".show_help("How much does each member earn when buy a Special? 0.05 = 5% , 0 = Disabled, 1 = Doubled")."</td>
        <td><input type=\"text\" name=\"purchase_bonus\" value=\"$settings[purchase_bonus]\"> (0.05 = 5% , 0 = Disabled, 1 = Doubled)</td>
    </tr>


and that's it ...



now go to 
/wizards/pfunctions.php


and look for

function bought_special($order) {



ok in that part ... lookk for this   part


            if($benefit[type] != "") {
                if($benefit[type] == "referrals") {
                    $sql2=$Db1->query("SELECT userid FROM user WHERE refered='' and username!='$order[username]'");
                    $totalrefsavailable=$Db1->num_rows();
                    $refstoassign = $benefit[amount]*$order[amount];
                    if($totalrefsavailable < $refstoassign) {
                        $refstoassign=$totalrefsavailable;
                        $amounts=1;
                    }
                    for($x=0; $x<$refstoassign; $x++) {
                        assign($order[username]);
                    }
                }
                else {
                         $sql=$Db1->query("UPDATE user SET $benefit[type]=$benefit[type]+".($benefit[amount]*$order[amount])." WHERE username='".addslashes($order[username])."'");
                }
            }
        }




and the trick is replace this part ..
            $sql=$Db1->query("UPDATE user SET $benefit[type]=$benefit[type]+".($benefit[amount]*$order[amount])." WHERE username='".addslashes($order[username])."'");

with this part

  $sql=$Db1->query("UPDATE user SET $benefit[type]=$benefit[type]+".(($benefit[amount]*$order[amount])+(($benefit[amount]*$order[amount])*$settings[purchase_bonus]))." WHERE username='".addslashes($order[username])."'");

now u  have a buy 1 get X free
*****************************************************

Now, when we showed this to our test admins and several clients, it was determined that since this only works on the specials that it did not really meet the demands of our clients. So I have completely coded the add on below myself (yes I used the same format, but once a person attains knowledge its hard to forget it ).  This mod will allow you to have the bogx mod on all ad types (including flinks), referrals, memberships, and specials.  It also has a nice little message that appears on the purchase pages so you can advertise these specials to your members (of course with an admin enable / disable feature).  Now lets begin:

Step 1:   Code in the admin2/settings/products.php file:

add these lines in the upper area where you see all the other settings:

$settings["bogxfreeamount"]            =   "$bogxfreeamount";
$settings["bogxfreemsg"]            =   "$bogxfreemsg";

Now go down into the area where you see the stuff on that page and insert this where you want it to show up:

<tr>
   <td></td>
   <td>-----------------------------------</td>
</tr>
<tr>
   <td></td>
   <td><b>Buy One Get X Free Special</b></td>
</tr>
<tr>
   <td></td>
   <td>-----------------------------------</td>
</tr>         
<tr>
   <td></td>
   <td><b>Activate BOGX Free <br> Special Message: </b><br><small>This option will activate the BOGX Free<br>      Specials Message on the purchase page.</small></td>
            
   <td><input type=\"checkbox\" name=\"bogxfreemsg\" value=\"1\"".iif($settings[bogxfreemsg] == 1," checked=\"checked\"")."></td>
</tr>
<tr>
   <td></td>
   <td><b>Buy One Get X Free<br> Special Amount</b><br><small>This is the amount of X. For example,<br> place a 1 for buy one get 1 free.<br> SET TO ZERO (0) FOR NO SPECIAL</td>
            
   <td><input type=\"text\" size=\"4\" name=\"bogxfreeamount\" value=\"$settings[bogxfreeamount]\"></td>
</tr>


Now, lets go add the nice little message on the prices.php file:  Add what is in bold:

<?
$includes[title]="Purchase Advertising";
$includes[content]="
".iif($settings[bogxfreemsg] ==1,"
<div style=\"background-color: lightblue; border: 1px solid green; margin: 10px;\"><center>We are offering a buy one get $settings[bogxfreeamount] free special for a limited time only.  PURCHASE TODAY!!</div>")."


Now we go to the real work of this mod, its the wizards/pfunctions.php file.  This is  a lot of code here, but easy  mrgreen
Just add what is in between the bold marks 

Code:
Line 10:  global $procs, $Db1, $headers, $secondamount, [b]$settings[/b];

Line 20:  credits=credits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount][/b],

Line 31: global $procs, $Db1, $headers, $secondamount,[b] $settings[/b];

Line 39: $sql=$Db1->query("UPDATE ptrads SET credits=credits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount][/b], ......

Line 44: global $procs, $Db1, $headers,[b]$settings[/b];

Line 55:  $sql=$Db1->query("UPDATE popups SET credits=credits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount][/b] WHERE id='$order[ad_id]'");

Line 61:  global $procs, $Db1, $headers, [b]$settings[/b];

Line 72:  $sql=$Db1->query("UPDATE ptsuads SET credits=credits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount][/b],  ............

Line 77:  global $procs, $Db1, $headers, [b]$settings[/b];

Line 92: $sql=$Db1->query("UPDATE user SET ptsu_credits=ptsu_credits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount][/b] WHERE username='$order[username]'");

Line 99:  global $procs, $Db1, $headers, [b]$settings[/b];

Line 110:  $sql=$Db1->query("UPDATE emails SET credits=credits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount][/b] WHERE id='$order[ad_id]'");

Line 115:  global $procs, $Db1, $headers, [b]$settings[/b];

Line 130:  $sql=$Db1->query("UPDATE user SET link_credits=link_credits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount] [/b]WHERE username='$order[username]'");

Line 152:   global $procs, $Db1, $headers, [b]$settings[/b];

Line 160:  $sql=$Db1->query("UPDATE user SET xcredits=xcredits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount] [/b]WHERE username='$order[username]'");

Line 166:  global $procs, $Db1, $headers, [b]$settings[/b];

Line 181:  $sql=$Db1->query("UPDATE user SET banner_credits=banner_credits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount] [/b]WHERE username='$order[username]'");

Line 186:  global $procs, $Db1, $headers, [b]$settings[/b];

Line 201:  $sql=$Db1->query("UPDATE user SET fbanner_credits=fbanner_credits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount][/b] WHERE username='$order[username]'");

Line 206:  global $procs, $Db1, $headers, [b]$settings[/b];

Line 221:  $sql=$Db1->query("UPDATE user SET fad_credits=fad_credits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount][/b] WHERE username='$order[username]'");

Line 226:  global $procs, $Db1, $headers, [b]$settings[/b];

Line 244:  $sql=$Db1->query("UPDATE user SET popup_credits=popup_credits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount][/b] WHERE username='$order[username]'");

Line 249:  global $procs, $Db1, $headers, [b]$settings[/b];

Line 267: $sql=$Db1->query("UPDATE user SET ptr_credits=ptr_credits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount] [/b]WHERE username='$order[username]'");

Line 272:  global $procs, $Db1, $headers, [b]$settings[/b];

Line 290:  $sql=$Db1->query("UPDATE user SET ptra_credits=ptra_credits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount][/b] WHERE username='$order[username]'");

Line 296:  global $procs, $Db1, $headers, [b]$settings[/b];

Line 304:  $sql=$Db1->query("UPDATE banners SET credits=credits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount][/b] WHERE id='$order[ad_id]'");

Line 309:  global $procs, $Db1, $headers, [b]$settings[/b];

Line 317:  $sql=$Db1->query("UPDATE fbanners SET credits=credits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount][/b] WHERE id='$order[ad_id]'");

Line 322:  global $procs, $Db1, $headers, [b]$settings[/b];

Line 331:  $sql=$Db1->query("UPDATE fads SET credits=credits+$order[amount][b]+$order[amount]*$settings[bogxfreeamount] [/b]WHERE id='$order[ad_id]'");

Line 336:  global $procs, $Db1, $headers, [b]$settings[/b];

Line 343:  $duration=2678400*$order[amount][b]+2678400*$order[amount]*$settings[bogxfreeamount][/b];

Line 364:  global $procs, $Db1, $headers, [b]$settings[/b];

Line 386:  [b]$duration=$duration+$duration*$settings[bogxfreeamount];[/b]

Line 451:  $refstoassign = $benefit[amount]*$order[amount][b]+ (($benefit[amount]*$order[amount])*$setting[bogxfreeamount])[/b];

Line 461:  $sql=$Db1->query("UPDATE user SET $benefit[type]=$benefit[type]+".(($benefit[amount]*$order[amount])[b]+(($benefit[amount]*$order[amount])*$settings[bogxfreeamount]))." [/b]WHERE username='".addslashes($order[username])."'");







« Last Edit: Apr 26, 2010 07:30 pm by 757jterrell » Logged

Duality
Reputation: (+1)
*

Offline

Gender: Male
Posts: 390
Referrals: 0

Currently booked with boredom.

View Profile
Reply #1: Apr 26, 2010 07:32 pm

Don't forget that when you insert the code into the file, to take out the
Code:
[b] and [/b].
 
« Last Edit: Apr 26, 2010 07:41 pm by Duality » Logged

Traditional based tactics on scammers do not work. Instead of attacking when they pop out of the bushes, do the right thing. Remind them just how petty they really are. A scammer that's attacked comes back, while a scammer that's belittled stays far far away.

Help me help EMS. Send North Owl a pm, suggesting that scammers don't get banned, but get a special neon pink scammer badge!
Specter
Reputation: (+104)
*

Offline

Gender: Male
Posts: 10359
Referrals: 27


View Profile
Reply #2: Apr 26, 2010 07:44 pm

So this will work for every product if we had
Code:
<tr>
   <td></td>
   <td>-----------------------------------</td>
</tr>
<tr>
   <td></td>
   <td><b>Buy One Get X Free Special</b></td>
</tr>
<tr>
   <td></td>
   <td>-----------------------------------</td>
</tr>         
<tr>
   <td></td>
   <td><b>Activate BOGX Free <br> Special Message: </b><br><small>This option will activate the BOGX Free<br>      Specials Message on the purchase page.</small></td>
           
   <td><input type=\"checkbox\" name=\"bogxfreemsg\" value=\"1\"".iif($settings[bogxfreemsg] == 1," checked=\"checked\"")."></td>
</tr>
<tr>
   <td></td>
   <td><b>Buy One Get X Free<br> Special Amount</b><br><small>This is the amount of X. For example,<br> place a 1 for buy one get 1 free.<br> SET TO ZERO (0) FOR NO SPECIAL</td>
           
   <td><input type=\"text\" size=\"4\" name=\"bogxfreeamount\" value=\"$settings[bogxfreeamount]\"></td>
</tr>

After each product?
Logged

Living in a World filled with more fake people than real, so I'm in a situation where the masses don't feel me.
Developz
Reputation: (+11)
*

Offline

Gender: Male
Posts: 378
Referrals: 0


View Profile
Reply #3: Apr 26, 2010 07:46 pm

Sorry but this is very confusing.
Logged
757jterrell
Reputation: (+29)
*

Offline

Gender: Male
Posts: 967
Referrals: 0


Get a site from the OWNERS of the script!!!

View Profile WWW
Reply #4: Apr 26, 2010 07:48 pm

Yes it should work with every product,  we have had it test on several site with no problems or errors. Of course we may made a mistake here or there, if anyone finds a mistake please notify us.

If you need me to post it in the long format I can, lol
Logged

Developz
Reputation: (+11)
*

Offline

Gender: Male
Posts: 378
Referrals: 0


View Profile
Reply #5: Apr 26, 2010 07:49 pm

Yes it should work with every product,  we have had it test on several site with no problems or errors. Of course we may made a mistake here or there, if anyone finds a mistake please notify us.

If you need me to post it in the long format I can, lol


Can you not just upload the php files?
Logged
757jterrell
Reputation: (+29)
*

Offline

Gender: Male
Posts: 967
Referrals: 0


Get a site from the OWNERS of the script!!!

View Profile WWW
Reply #6: Apr 26, 2010 07:52 pm


Can you not just upload the php files?

Not really, we have other things added to these same files that we are not giving away. But, here is the long format, it really is not hard at all.

Line 10:  global $procs, $Db1, $headers, $secondamount, $settings;

Line 20:  credits=credits+$order[amount]+$order[amount]*$settings[bogxfreeamount],

Line 31: global $procs, $Db1, $headers, $secondamount, $settings;

Line 39: $sql=$Db1->query("UPDATE ptrads SET credits=credits+$order[amount]+$order[amount]*$settings[bogxfreeamount], ......

Line 44: global $procs, $Db1, $headers,$settings;

Line 55:  $sql=$Db1->query("UPDATE popups SET credits=credits+$order[amount]+$order[amount]*$settings[bogxfreeamount] WHERE id='$order[ad_id]'");

Line 61:  global $procs, $Db1, $headers, $settings;

Line 72:  $sql=$Db1->query("UPDATE ptsuads SET credits=credits+$order[amount]+$order[amount]*$settings[bogxfreeamount],  ............

Line 77:  global $procs, $Db1, $headers, $settings;

Line 92: $sql=$Db1->query("UPDATE user SET ptsu_credits=ptsu_credits+$order[amount]+$order[amount]*$settings[bogxfreeamount] WHERE username='$order[username]'");

Line 99:  global $procs, $Db1, $headers, $settings;

Line 110:  $sql=$Db1->query("UPDATE emails SET credits=credits+$order[amount]+$order[amount]*$settings[bogxfreeamount] WHERE id='$order[ad_id]'");

Line 115:  global $procs, $Db1, $headers, $settings;

Line 130:     $sql=$Db1->query("UPDATE user SET link_credits=link_credits+$order[amount]+$order[amount]*$settings[bogxfreeamount] WHERE username='$order[username]'");

Line 152:   global $procs, $Db1, $headers, $settings;

Line 160:  $sql=$Db1->query("UPDATE user SET xcredits=xcredits+$order[amount]+$order[amount]*$settings[bogxfreeamount] WHERE username='$order[username]'");

Line 166:  global $procs, $Db1, $headers, $settings;

Line 181:  $sql=$Db1->query("UPDATE user SET banner_credits=banner_credits+$order[amount]+$order[amount]*$settings[bogxfreeamount] WHERE username='$order[username]'");

Line 186:  global $procs, $Db1, $headers, $settings;

Line 201:  $sql=$Db1->query("UPDATE user SET fbanner_credits=fbanner_credits+$order[amount]+$order[amount]*$settings[bogxfreeamount] WHERE username='$order[username]'");

Line 206:  global $procs, $Db1, $headers, $settings;

Line 221:  $sql=$Db1->query("UPDATE user SET fad_credits=fad_credits+$order[amount]+$order[amount]*$settings[bogxfreeamount] WHERE username='$order[username]'");

Line 226:  global $procs, $Db1, $headers, $settings;

Line 244:  $sql=$Db1->query("UPDATE user SET popup_credits=popup_credits+$order[amount]+$order[amount]*$settings[bogxfreeamount] WHERE username='$order[username]'");

Line 249:  global $procs, $Db1, $headers, $settings;

Line 267: $sql=$Db1->query("UPDATE user SET ptr_credits=ptr_credits+$order[amount]+$order[amount]*$settings[bogxfreeamount] WHERE username='$order[username]'");

Line 272:  global $procs, $Db1, $headers, $settings;

Line 290:  $sql=$Db1->query("UPDATE user SET ptra_credits=ptra_credits+$order[amount]+$order[amount]*$settings[bogxfreeamount] WHERE username='$order[username]'");

Line 296:  global $procs, $Db1, $headers, $settings;

Line 304:  $sql=$Db1->query("UPDATE banners SET credits=credits+$order[amount]+$order[amount]*$settings[bogxfreeamount] WHERE id='$order[ad_id]'");

Line 309:  global $procs, $Db1, $headers, $settings;

Line 317:  $sql=$Db1->query("UPDATE fbanners SET credits=credits+$order[amount]+$order[amount]*$settings[bogxfreeamount] WHERE id='$order[ad_id]'");

Line 322:  global $procs, $Db1, $headers, $settings;

Line 331:  $sql=$Db1->query("UPDATE fads SET credits=credits+$order[amount]+$order[amount]*$settings[bogxfreeamount] WHERE id='$order[ad_id]'");

Line 336:     global $procs, $Db1, $headers, $settings;

Line 343:  $duration=2678400*$order[amount]+2678400*$order[amount]*$settings[bogxfreeamount];

Line 364:  global $procs, $Db1, $headers, $settings;

Line 386:  $duration=$duration+$duration*$settings[bogxfreeamount];

Line 451:  $refstoassign = $benefit[amount]*$order[amount]+ (($benefit[amount]*$order[amount])*$setting[bogxfreeamount]);

Line 461:  $sql=$Db1->query("UPDATE user SET $benefit[type]=$benefit[type]+".(($benefit[amount]*$order[amount])+(($benefit[amount]*$order[amount])*$settings[bogxfreeamount]))." WHERE username='".addslashes($order[username])."'");



         
   
Logged

17910
Reputation: (+2)
*

Offline

Gender: Male
Posts: 225
Referrals: 0


View Profile WWW
Reply #7: Apr 26, 2010 08:00 pm

We do regular promotions at work where you buy one get one half price, it's an appealing offer for our customers as they see it as they're saving money, I see it as the customer paying 50% more for something that costs very little anyway mrgreen

If that doesn't work we offer a combination of two items and discount a different item if they purchase the combo XD

So they get a small discount on the combo and suggestive sold the third item at a discounted rate somewhere in the region of a 15% reduction.

My daily takings not including returning my float average around $1200 in a 7hr shift so I can honestly say, it works!
Logged

Specter
Reputation: (+104)
*

Offline

Gender: Male
Posts: 10359
Referrals: 27


View Profile
Reply #8: Apr 26, 2010 08:04 pm

Yes it should work with every product,  we have had it test on several site with no problems or errors. Of course we may made a mistake here or there, if anyone finds a mistake please notify us.

If you need me to post it in the long format I can, lol

Ok, i will try it out, thanks high5
Logged

Living in a World filled with more fake people than real, so I'm in a situation where the masses don't feel me.
Developz
Reputation: (+11)
*

Offline

Gender: Male
Posts: 378
Referrals: 0


View Profile
Reply #9: Apr 26, 2010 08:18 pm

Ok, I've added it. Everything seemed to be working, however when purchased automatic updating ain't happening at all.
Logged
757jterrell
Reputation: (+29)
*

Offline

Gender: Male
Posts: 967
Referrals: 0


Get a site from the OWNERS of the script!!!

View Profile WWW
Reply #10: Apr 26, 2010 08:30 pm

Ok, I've added it. Everything seemed to be working, however when purchased automatic updating ain't happening at all.

I will look at it tomorrow, its late here and I have to be at work at 5am, but we have not had a problem with the purchases at all.
Logged

Developz
Reputation: (+11)
*

Offline

Gender: Male
Posts: 378
Referrals: 0


View Profile
Reply #11: Apr 26, 2010 08:36 pm

Tis ok, I'll look and try and work why it isn't updating.
Logged
757jterrell
Reputation: (+29)
*

Offline

Gender: Male
Posts: 967
Referrals: 0


Get a site from the OWNERS of the script!!!

View Profile WWW
Reply #12: Apr 26, 2010 08:53 pm

Ok, we just did 5 test purchases on 5 different sites with this mod and all worked correctly. Where exactly is it not working for you??
Logged

Developz
Reputation: (+11)
*

Offline

Gender: Male
Posts: 378
Referrals: 0


View Profile
Reply #13: Apr 26, 2010 09:04 pm

Ah lol, I was trying to do a Test Transaction with Alertpay and it wasn't working. Stupid me , I already did one and it wouldn't overwrite the old one so that's why it wasn't working.  rofl   Totally my fault.
Logged
friendishan
Reputation: (+64)
*

Offline

Gender: Male
Posts: 4204
Referrals: 6


Meet The Weirdos!

View Profile WWW
Reply #14: Apr 27, 2010 08:24 am

 frusty Free stuff needs hard work  rofl
Logged

Print
 
Jump to:  
Copyright © 2008-2022 eMoneySpace. All rights reserved.