It looks like you are using a database connection named "shop" and your eCart is also named "shop"... that is causing conflicts.
You will have to rename one or the other.
I'd also move the code from lines: 11-18 down below the add to cart code that ends on line 183