Clues integrating jcart in Drupal 7 jcart is a great shopping cart that uses a php class inside a jcart.php file. The cart is being displayed 

&lt;div id="jcart"&gt;&lt;?php $jcart-&gt;display_cart();?&gt;&lt;/div&gt;


I managed to create a module to list the product items and the form with 'add to cart' button, also to include the jcart.css and jcart.js inside everypage. The only thing I need to include more are:


the mymodule/jcart/jcart.php


I tried to include it in my header of html.tpl.php but I get an error while displaying $jcart-&gt;display_cart(). The error is:


  Fatal error: Call to a member function display_cart() on a non-object
  in...



To add a class to the form: class 


If there is someone could help I would appreciate it.
You need to include the file itself, module_load_include can help you with that. Then you need to instantiate the class, you should read the docs about jcart to figure out how to do that, but something like

 $jcart = new jCart($args);


This can be done in your theme, or ever better create block in your module than will display the cart and that will invoke display_cart.

Note I don't know anything about jcart, and as such the code is just an illustration.