Added stuff to calculate prices and handle postmeta