As far as I know,this article I wrote on stack overflow is the most in depth guide for developers. It assumes you have some knowledge of PHP/MySQL and while it doesn't explain a "module" as such, it gives you the building blocks to figure out what a module's code is doing and why - and should help you replicate it

$this->cart->hasProducts() - returns true if there is at least one item in the cart
$this->cart->hasStock() - returns false if there is at least one item in the cart that is out of stock
$this->cart->hasProducts() - returns true if there is at least one item in the cart that requires shipping

$this->cart->hasProducts() - returns true if there is at least one item in the cart
$this->cart->hasStock() - returns false if there is at least one item in the cart that is out of stock
$this->cart->hasShipping() - returns true if there is at least one item in the cart that requires shipping