Hi,
Iīm implementing some external javascript code in our store to track user behaviour. But I cannot get the values of the variables to be shown.

Iīm putting the code in a new file in includes/modules/pages/product_info/jscript_track.php
and in another javascript in a new file in ../modules/pages/shopping_cart/jscript_trackcart.php
The javascript is shown correctly, but the variables donīt show anything.

The variables I would like to show in the javascript on the productpage:
Product name, product model and product price.
I tried the following parts of code to show them: <?php echo $products_name ?>, <?php echo $products_model ?> and <?php echo $products_price ?> but this didnīt work. I suppose the connection with the database and a query is missing.

The variables I would like to show in the javascrip on the shoppingcartpage:
Product ID, Quantity, Price of the product in the cart. If there are more products in the cart also the same data of the other products.

How do I connect to the database, from these files? And can anyone help me with how to put the sql query?

Thanks,