Technical Help - Coexistance of CMS-Builder with X-Cart Shopping Cart software

4 posts by 2 authors in: Forums > CMS Builder
Last Post: December 3, 2009   (RSS)

Re: [garyhoffmann] Technical Help - Coexistance of CMS-Builder with X-Cart Shopping Cart software

By Dave - December 3, 2009

Hi Gary,

Is there a specific order that X-Cart and CMSB need to be called in? If it's possible to just load the viewer_functions first and load all the records you need for CMSB, then load xcart and call it's function below that, then that would probably be the simplest.

Let me know if that would work for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Technical Help - Coexistance of CMS-Builder with X-Cart Shopping Cart software

By garyhoffmann - December 3, 2009

Thank you for the reply, but that would only work for a single page - as soon as the page changes, the database connections get mixed up.

As I'm using CMSB for nav, etc., that has to be available on all pages.

Gary.

Re: [garyhoffmann] Technical Help - Coexistance of CMS-Builder with X-Cart Shopping Cart software

By Dave - December 3, 2009

As long as you load all the CMSB records at the top of the page before anything else you should be fine. If you have code in includes that calls getRecords() that won't work though because the code in includes won't be at the top of the page and might be being called after xcart.

Also, CMSB uses the default connection, so if you wanted to close that before including any x-cart code you could do that with this line:
mysql_close(); // php function

And if needed to reconnect to the CMSB database and set it as the default you can do that like this:
connectToMySQL(); // cmsb function

And I think you can get the current link like this:
$link = mysql_connect();

You might want to look through the mysql functions and see what's possible:
http://www.php.net/manual/en/function.mysql-connect.php

So even if you aren't able to have all your CMSB code that loads records at the top of each page then perhaps with that code you could get it to work?

Hope that helps! Let me know how it goes.
Dave Edis - Senior Developer
interactivetools.com