Resolved
Now a mod--
Click!
OK, so I'm trying to essentially copy the files adoptview.php, adopt.php, and lang_adopt.php in order to create more adoption centers such as these because I'm able to individually customize the stores a lot more then.
However I've run into a road block. I don't know how to make it, when using these files, so that when a user "adopts" a cat that has a cost set to it, it subtracts the cost from the user's amount of currency. I can see where it happens in the shop files, but I'm not sure how to convert that over to the adopt files.
I think this is the function I need, but I don't know how to include/implement it in the shopname.php or shopnameview.php files (which are just versions of the adopt.php and adoptview.php files);
PHP Code:
public function purchase($adopt){
$mysidia = Registry::get("mysidia");
if($adopt->owner != $mysidia->user->username) Throw new NoPermissionException('Something is very very wrong, please contact an admin asap.');
else{
$cost = $adopt->getcost($this->salestax);
$moneyleft = $mysidia->user->money - $cost;
if($moneyleft >= 0){
$purchase = $adopt->append($adopt->owner);
$mysidia->db->update("users", array("money" => $moneyleft), "username = '{$adopt->owner}'");
$status = TRUE;
}
else throw new InvalidActionException($mysidia->lang->money);
}
return $status;
}
Would anyone be able/willing to help with this?