I've not worked with grpg before but I do have experience in MCC, so please bare that in mind as you continuing reading my reply 😅
The conversion would take place in drugmarket.php, the SQL seems applicable to both engines.
To go from grpg to mcc yourll need to make sure your globals or global func file is included rather than the Inc/header
The queries within this script will need to be rewritten to mcc requirements, Ie I'm not sure mcc supports what I call class queries ($drug = $db->fetch(true);) so yourll have to run these checks for money and quantity slightly different, calling the fields from the database and running then through an if statement or boolean ((x=1) ? true: false)) statement
Yourll have to check that any functions used (ie. prettynum(integar)) are declared in your global func or make a similar function or use pre existing PHP functions (number_format, round etc)
To be honest, that was all a guess based off historic experience so do let me know how it goes/if this is helpful/correct in anyway 😁
Should be a good start for you anyway