PHP - determining values in euro and credits

Asked

Viewed 31 times

2

I have a sales website where I use credits for "discounts".

What I want to do is if the product is 5.00€ and the user has 100 credits

These 100 credits will discount X value at 5.00€.

Example, Knowing that 10 credits discount about 0.01 cents (this is an idea)

How do I have the code check the credits and deduct the total amount?

Variables:

$cada10vale = 0.01;
$creditos_do_utilizador = $row['creditos'];
$preço_total_em_euros = $_SESSION['cart_total'];
  • 1

    ... $preco_total_com_desconto = $preço_total_em_euros - (abs($creditos_do_utilizador / 10) * $cada10vale), no? Or lost something in the problem description?

  • Will deduct from the total value or from a specific product?

  • total value account only

  • $Otal = $price_total_em_euros - (abs($creditos_do_username / 1000));

  • Dude, don’t use special characters on the variables, take this price cedilla because it will give dick early pu late.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.