Jump to content
MakeWebGames

Recommended Posts

Posted

Hey there i took virtualshogun's mod and made it a little better. his mod was where you set the discount for the item on the code, mine is where you set it for each one in the staff menu.

first off run this sql. [mysql]ALTER TABLE `items` ADD `discount` INT(3) NOT NULL DEFAULT '0';[/mysql]

then In staff_items.php find:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

and under add

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

FIND:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

FIND the query, before

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

replace with

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

FIND

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

ADD UNDER

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

FIND THE QUERY and do the same as above, the $discount part and the query part

then replace shops with:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Replace itmbuy with this:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Posted

even better (and more efficient) would be to add a single variable to the settings table, which would be the percentage you want donators to have off the regular prices (so you don't have to set a discount price on every item).

For example:

In the settings table, add the variable 'dondiscount' and set it to 10 (for a 10% discount).

Then on the shops.php page (or wherever it is you buy items) update the $itemcost variable with an if statement as follows:

if($ir['donator_days']>0)

{

$itemcost = $itemcost - ($itemcost * $set['dondiscount']);

}

 

There we have it. One new variable in the database, 3-4 lines of code added to your php files, and you don't have to reinput tons of new prices for donators. Win. :D

Posted
But what about if you wanted individual item discounts?

Then yes, I 'spose yours would work better. I've just seen in games I've run or helped run that we'd get close to a thousand items... and setting a discount for each of them would be tedious beyond belief, and unnecessary.

I've always been a fan of Occam's Razor myself though. In my mind, donators would prefer a blanket discount than an individual item discount.

Posted

just a little clairification on something <img src= 'toys/".$r['itmid'].".jpg' border='0' width = '50' height = '50'> thats a folder in your root named toys (items)

it goes 1.jpg , 2.jpg , 3.jpg and so on its useing the item number then .jpg extension just so people dont use this or mine and go where did my pics go if you have it somewhere else, nice addon danny

  • 11 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...