diff --git a/html/catalog/view.php b/html/catalog/view.php
index 64a0846..b105a42 100644
--- a/html/catalog/view.php
+++ b/html/catalog/view.php
@@ -1,5 +1,6 @@
You don't have enough Alphabux";
- }
- elseif ($result == 1)
- {
- $alert = "
You already own this item
";
- }
- elseif ($result == 2)
- {
- WebContextManager::Redirect("/catalog/view?id=". $id . "");
+ try {
+ if (EconomyHelper::PurchaseItem($user->id, $id)) {
+ WebContextManager::Redirect("/catalog/view?id=". $id . "");
+ }
+ } catch (Exception $e) {
+ $alert = "".$e->getMessage()."
";
}
}
// ...
diff --git a/html/create/index.php b/html/create/index.php
index 8af6aac..f01de3b 100644
--- a/html/create/index.php
+++ b/html/create/index.php
@@ -5,6 +5,7 @@ Alphaland 2021
*/
use Alphaland\Assets\Asset;
+use Alphaland\Economy\EconomyHelper;
use Alphaland\Web\WebContextManager;
$body = '';
@@ -172,7 +173,7 @@ function uploadCosmetic()
}
//remove currency
- if (!removeCurrency($minimumprice, "Creation of cosmetic name ".$name))
+ if (!EconomyHelper::RemoveAlphabux($minimumprice, $GLOBALS['user']->id, "Creation of cosmetic name ".$name))
{
return "You don't have enough currency";
}