This has 2 bugs:
1. When you toggle the on/off button on the upgrades page for a particular upgrade you get a warning.
View attachment 331299
"Oops! We ran into some problems.
Please enter a number that is at least 5.00."
But, the price is set to $5 and the preset starts at $5.
It can be turned on/off inside the upgrade without the error. I believe this is caused when Presets is enabled and the last line is 0. You cannot remove the line that says 0. All fields are set correctly and happens on all the upgrades.
2. When trying to disable Presets by unchecking the box after you set some presets, you get this error:
ValueError: max(): Argument #1 ($value) must contain at least one element in src/addons/OzzModz/UserUpgradeCustomAmount/XF/Admin/Controller/UserUpgrade.php at line 17
max() in src/addons/OzzModz/UserUpgradeCustomAmount/XF/Admin/Controller/UserUpgrade.php at line 17
OzzModz\UserUpgradeCustomAmount\XF\Admin\Controller\UserUpgrade->upgradeSaveProcess() in src/XF/Admin/Controller/UserUpgradeController.php at line 131
XF\Admin\Controller\UserUpgradeController->actionSave() in src/XF/Mvc/Dispatcher.php at line 362
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 264
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 121
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 63
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2824
XF\App->run() in src/XF.php at line 806
XF::runApp() in admin.php at line 15
Even if I make every field 0 and click to save to try to remove, still, the error.
Suggestions:
Can you please have the USD display the decimal amount with two digits? For example if I set the price to $2.50 it displays as $2.5 which looks odd. Also better if $5 says $5.00, because it does on the XF portion of the upgrade on the same page.
The other suggestion is can the presets auto-arrange in order? This isn't a huge deal really, but, let's say I have 3,4,5,6,7,8 dollars. Now I want add 2 dollars. I have to add it to the bottom. When I save, and look at the upgrades page, it is still at the bottom, so I have to redo all the presets in order.
Thanks! I really like this.