Jump to content

ModX & WHMCS integration


jkletch

Recommended Posts

My Site is making progress. Its built using ModX CMS with the WHMCS integration coming along. Wishing I could get WHMCS to use the theme from the main site, digging into that is next.

 

Here's my hosting page:

http://www.mulehill.com/hosting/

 

I was originally using the WHMCS java script to get the 'name', 'price', and 'description' from WHMCS as shown in the widget documentation on this site, however that data was not readable by the search engines: view source would simply show the java script, i.e., "<script type="text/javascript" language="javascript" src="services/widgets/productsinfo.php?pid=5&get=description"></script>"

 

I am now using PHP to pull the data right from the DB and its working great. Here a sample of the code used to pull the basic description:

 

<?php

ini_set('display_errors',1);

error_reporting(E_ALL);

require '/usr/home/mulehill.com/html/services/configuration.php';

$link = mysql_connect($db_host,$db_username,$db_password);

mysql_select_db($db_name);

 

// Retrieve all the data from the "Products" table

$result = mysql_query("SELECT * FROM tblproducts where id=5 LIMIT 0, 30 ")

or die(mysql_error());

 

// store the record of the "Products" table into $row

$row = mysql_fetch_array( $result );

// Print out the contents of the entry

 

echo $row['description'];

?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated