Thread: Mys 1.3.4 Second Currency Mod
View Single Post
  #4  
Old 06-01-2017, 06:39 AM
Fox Fox is offline
Member
 
Join Date: Oct 2016
Location: Australia
Posts: 34
Gender: Female
Credits: 5,948
Fox is on a distinguished road
Default

Now onto the class_stockadopt.php

Find:
PHP Code:
class StockAdopt{
  
// The StockItem class, which defines items currently in Itemshop and thus is not owned by any users
  
  
public $id 0;
  public 
$type;
  public 
$class;
  public 
$description;
  public 
$eggimage;
  public 
$whenisavail;
  public 
$alternates;     
  public 
$altoutlevel;    
  public 
$altchance;     
  public 
$cost;
  public 
$owner
And again, add this beneath public cost:
PHP Code:
public $premiumcost 
Then find:
PHP Code:
public function getcost($salestax 0){
      
// Get the total cost of this stock item
      
$cost $this->cost*(1+$salestax/100);
      return 
$cost;
  } 
And add below:
PHP Code:
public function getpremiumcost{
      
// Get the total cost of this stock item
      
$premiumcost $this->premiumcost;
      return 
$premiumcost;
  } 
Now we'll jump into the AdminCP files. In there, find the adopt.php

Find this chunk:
PHP Code:
$mysidia->db->insert("adoptables", array("id" =>  NULL"type" => $mysidia->input->post("type"), "class" =>  $mysidia->input->post("class"), "description" =>  $mysidia->input->post("description"), "eggimage" => $eggimage,  "whenisavail" => $mysidia->input->post("cba"),
                                                     
"alternates" =>  $mysidia->input->post("alternates"), "altoutlevel" =>  $mysidia->input->post("altoutlevel"), "altchance" =>  $mysidia->input->post("altchance"), "shop" =>  $mysidia->input->post("shop"), "cost" =>  $mysidia->input->post("cost"), "genderratio" =>  $mysidia->input->post("genderratio"))); 
and replace with:
PHP Code:
$mysidia->db->insert("adoptables", array("id" =>  NULL"type" => $mysidia->input->post("type"), "class" =>  $mysidia->input->post("class"), "description" =>  $mysidia->input->post("description"), "eggimage" => $eggimage,  "whenisavail" => $mysidia->input->post("cba"),
                                                     
"alternates" =>  $mysidia->input->post("alternates"), "altoutlevel" =>  $mysidia->input->post("altoutlevel"), "altchance" =>  $mysidia->input->post("altchance"), "shop" =>  $mysidia->input->post("shop"), "cost" =>  $mysidia->input->post("cost"), "premiumcost" =>  $mysidia->input->post("premiumcost"), "genderratio" =>  $mysidia->input->post("genderratio"))); 
Then we'll jump into the view folder in the AdminCP file to adoptview.php

Find this:
PHP Code:
$shopSettings->add(new Comment("Price: "FALSE));
        
$shopSettings->add(new TextField("cost"010)); 
And add beneath it:
PHP Code:
$shopSettings->add(new Comment("Premium Price: "FALSE));
        
$shopSettings->add(new TextField("premiumcost"010)); 
Next post for the final step!
Reply With Quote