nix, shell, perl, php, mysql and mac os x tips and tricks

Saturday, October 6, 2018

Formula for pricing buy X get X (buy 1 get 1 free) promos

python code:
each_price = ( (current_price * quantity) - (current_price * (int(quantity / (buyX + getX) * getX) ) ) ) / quantity

No comments:

Post a Comment