access session whmcs in php

2.1k views Asked by At

I have a nulled WHMCS script which I have used it on my hosting site.
When I add products to cart products added to cart in WHMCS page, but in that same domain I have created my own pages. For that reason being I want to use that session generated by WHMCS should be available on my page. but I am unable to do so.

Here is my code

$cartitems = count ($_SESSION['cart']['products']) 
    + count ($_SESSION['cart']['addons']) 
    + count ($_SESSION['cart']['domains']);
2

There are 2 answers

2
Lucas L Jordan On

I would say that this doesn't work since you can't share the WHMCS session.

You can Create Your Own WHMCS Pages - this allows you to utilise all of the WHMCS Internal API commands as well as access the WHMCS Session variables including the cart array.

0
DigiDamsel On

There are two little known files in the feed folder, cartnumitems.php and carttotal.php which should provide you with what you need. If you look at the documentation for feeds you should be able to see how these are used.

Otherwise I have used these are a basis to output the data I needed in JSON format and then used AJAX and jsonp to access the data.