The species has a cost set to it, but you need to pull up that information before you can use it. In the default shop's purchasing function, the line
$adopt->getcost($this->salestax); uses $adopt, but that $adopt refers to the species, not to the pet that was just adopted.
We can't use that, we already have a variable called $adopt which refers to the pet we just created, not the species as a whole.
Right after the pet is inserted into the database, try this (this should go in
adopts.php, obviously):
PHP Code:
$cost = $mysidia->db->select("adoptables", array("cost"), "type='{$adopt->getType()}'")->fetchColumn();
$mysidia->user->changecash(-$cost);
I suggest putting it before this line:
PHP Code:
$aid = $mysidia->db->select("owned_adoptables", array("aid"), "code='{$code}' and owner='{$mysidia->user->username}'")->fetchColumn();