aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-06-01 18:20:05 +0200
committerlonkaars <loek@pipeframe.xyz>2023-06-01 18:20:05 +0200
commit2197faf27421f3df01d7ae6618ddf12873dca3bb (patch)
treeaa92526fec25bc563b3174161dd6b5b5ca3b9bad /lib
parentc2b5ab68a84bf830f64e9c4e39f92b24c085c7e6 (diff)
admin-promo done
Diffstat (limited to 'lib')
-rw-r--r--lib/promo.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/promo.php b/lib/promo.php
new file mode 100644
index 0000000..ae200fa
--- /dev/null
+++ b/lib/promo.php
@@ -0,0 +1,13 @@
+<?php
+
+function promobuff2str($price_buff, $count_buff) {
+ if ($count_buff == 1) return ((1-$price_buff)*100)."% korting";
+ if ($count_buff <= 4) {
+ for ($i = $count_buff-1; $i > 0; $i--)
+ if (abs((($i/$count_buff)-$price_buff)/$price_buff) < 0.001)
+ return $i."+".($count_buff - $i)." gratis";
+ }
+ return ((1-$price_buff)*100)."% korting per ".$count_buff."-pack";
+}
+
+?>