How to make an item transparent but keep the shadow of it
Sure. You have two options:
You can disable camera visibility in the properties of the object:


Or you could make a material for it that is mixed with transparent shader with Light Paths node's Is Camera Ray output:


In this case you just need the condition Is Camera Ray to 'show' transparent shader and for the rest you don't even need a shader since it just needs to cast a shadow. 
Light paths node tends to slow down render time, so chances are the first method with object properties is going to be faster to render, but you can do more complex stuff with Light Paths node so it's worth knowing about.