Osclass Support Forums
Osclass plugin support => Osclass Pay Plugin => Topic started by: mwindey on September 13, 2022, 04:02:49 PM
-
First time i am trying to setup the plugin since i have it so forgive me if this is asked before.
In settings i can set default fee per 24 hours and it calculates using a formula. If i set 2 euro per 24 hours it sets 5.29 euro for 1 week.
Is there a way to set formula to count the same price per 24 hours so 1 week will be 14 euro, 2 weeks 28 euro ...instead of 5.29?
Thanks
-
Click on box and edit price :)
Editing parent will update children as well.
Formula is somewhere in functions.php, just default values here
-
@MB Themes
if i set 24 hours to 1 euro my expectation is that it multiplies the amount 7 times if i set it to 1 day and 1 week but that's not the case....
Like i said it's only the first day i am playing with this but i have to since sms payments is not supported anymore with fortumo/boku
-
Such formula would not make sense. You want users to pay more than they originslly wanted ;D
-
@MB Themes
I can confirm the issue.
If you set the price for 1 day to $2, then for 1 week the total is $5.29.
In this case, the correct multiplier would be $2*7= $14
What's the logic behind this? Discount for longer duration?
If so, then it would be nice for us to be able to set the discount based on a percentage setting.
For me, the way it is right now is a bit too much.
1 day - $10
1 week - $26.46
It's like you're ripping yourself off! :))
-
@MB Themes
It's not about ripping of someone it is only correct that if you have to pay €2 every 24 hours that the logic would be they have to pay 7 times the same amount every 24 hours so one week would be €14.
In situation it is now who's ripping who? ;D
Thanks @Tango to confirm the issue ;)
-
It's a bit like you're ripping yourself off, as the discount for 7 days vs 1 day is huge!
If you set 1 day to $10, then for 1 week it's $26.46 :o
You, as the site owner, are at a loss.
I understand to do a bit of upselling, and make the customer spend more money, but not with 62% discount :))
I would say a 15-20% discount would be okish, but still the best way would be for us to be able to set the upsell discount amount in the settings.
-
Correct! It would be nice to have the option for a discount in settings but i understand that maybe this is to difficult to create short term.
If it's working the correct way so €2/24h would become €14/1week then it would be nice for now :D :)
-
I think it is solved but needs some testing. In functions.php from plugin starting in line 2064
// HOURS UPLIFT FOR CALCULATION OF DEFAULT 24H FEE TO DIFFERENT HOURS
function osp_hours_uplift($fee, $hours = NULL) {
$price = $fee;
if($hours <> '' && $hours > 0) {
$days = $hours / 24;
if($days < 1) {
$price = $fee * pow($days, 1/4);
} else if($days > 1) {
$price = $fee * pow($days, 1/2);
} else {
$price = $fee;
}
}
return $price;
}
Change 1/4 and 1/2 to 1 delete the delimiter and it seems like that is solving the problem...
// HOURS UPLIFT FOR CALCULATION OF DEFAULT 24H FEE TO DIFFERENT HOURS
function osp_hours_uplift($fee, $hours = NULL) {
$price = $fee;
if($hours <> '' && $hours > 0) {
$days = $hours / 24;
if($days < 1) {
$price = $fee * pow($days, 1);
} else if($days > 1) {
$price = $fee * pow($days, 1);
} else {
$price = $fee;
}
}
return $price;
}
Discount ( Full price per 6hrs / 12hrs/ ... ) can be set in plugin itself per category and per period.
If you don't want a discount it counts the normal fee per day...
To be continued :-)