| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
#1
|
|||||||||
|
|||||||||
WordPress in X-Cart issue
I have installed and configured 'WordPress in X-Cart' for a 4.6.4 Gold site. When I enable the module, the x-cart front-end crashes, with an "Error establishing a database connection" message, in a blank page.
The X-Cart back-end works ok and when I disable the module, x-cart front-end works again. Also, both WordPress front-end and admin work ok when I enter directly in the WordPress site. The WP site is located in the X-Cart root. In the x-cart logs, the related log message is: "Cannot use object of type W3_Config as array in /home/sandblas/public_html/include/func/func.db.php on line 517" Any ideas?
__________________
Vasilis Vrontisis X-Cart Development, Maintenance & Customization https://[URL="http://www.craftforweb.com"]craftforweb.com[/url] vasilis@craftforweb.com |
|||||||||
#2
|
|||||||||
|
|||||||||
Re: WordPress in X-Cart issue
I think there is a conflict between your X-Cart and one of the plugins installed in your WordPress.
Try to deactivate all the WordPress plugins, then activate the "Integration with X-Cart" plugin and then activate the other plugins one-by-one to see which plugin is causing the problem. |
|||||||||
|
#3
|
|||||||||
|
|||||||||
Re: WordPress in X-Cart issue
Quote:
I had already done this, but no result. I tried to trace the code with a debugger in my local dev. server and I found out that in /wp-includes/ms-settings.php WP script file, close to line 57, the code searches for the current blog, by querying the WP database, via the input path in the browser. This is stored in the $current_blog variable, via the snippet: PHP Code:
The $current_blog variable was set to false, thus, leading to further empty object regarding the found current WP site and exiting the procedure, displaying the "Error establishing a database connection" message. From what I noticed, the $path variable was set to the x-cart root dir relative path (eg, if xcart is installed in /xcart root dir and the WP blog in /xcart/blog/ dir, then the $path variable was set to '/xcart/', leaving out the blog path part, thus not finding the blog. On the other hand, the $current_site->path value contains the path to the blog (/xcart/blog/), so I replaced the above line (comment: 'REPLACED LINE') with the one below: PHP Code:
After this, when I enable the 'WordPress in XCart' module, I don't get this database error, and the xcart site displays as normally expected, but when I go to the blog url, the blog doesn't display integrated inside the xcart site template, as expected, but it displays separately, on it's own. (Obviously, I have enabled the 'integration with xcart' module and also I have input the right path in the 'Path to WordPress directory (relative to X-Cart directory, 'blog' is used by default)' setting, in the 'WordPress in XCart' configuration page. Also, the xcart store is a clean 4.6.4 installation, out of the box, so no modified code exists). I understand that the code tweak I have done above is not a clean solution, it just 'patches' the situation, but at least, I don't get any php fatal errors in the logs. Also, there is no way that the WP developers have left such a bug here, so I probably tweaked the code in an atypical way. So, I was wondering if something else is wrong in the wp configuration paths, for example, or in the .htaccess files.
__________________
Vasilis Vrontisis X-Cart Development, Maintenance & Customization https://[URL="http://www.craftforweb.com"]craftforweb.com[/url] vasilis@craftforweb.com |
|||||||||
#4
|
|||||||||
|
|||||||||
Re: WordPress in X-Cart issue
Quote:
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#5
|
|||||||||
|
|||||||||
Re: WordPress in X-Cart issue
Mike, you might be right, I will try this if I don't find any solution, but this is supposed to be the default setup, ie, the blog dir being inside the x-cart root directory. For example, the "Path to WordPress directory (relative to X-Cart directory, 'blog' is used by default)" setting in the "WordPress in X-Cart" configuration page refers to a subdirectory of the root. The same is supposed to be implied in the module installation instructions.
__________________
Vasilis Vrontisis X-Cart Development, Maintenance & Customization https://[URL="http://www.craftforweb.com"]craftforweb.com[/url] vasilis@craftforweb.com |
|||||||||
|
#6
|
|||||||||
|
|||||||||
Re: WordPress in X-Cart issue
I may have misunderstood, I thought you were saying that Wordpress and X-cart were installed in the same directory. If X-cart is located at /xcart, then WordPress should be located at /xcart/blog. Or X-cart at root / and WP at /blog
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#7
|
|||||||||
|
|||||||||
Re: WordPress in X-Cart issue
Eventually, I solved the issue by doing two extra things:
- I removed any mod_rewrite rules in the .htaccess file of the WordPress root directory, because they broke the initial redirection - I tried to remove my code tweak posted in this thread, but then the site displayed the database connection error, so I retrieved it back. - I deactivated the W3 Total Cache plugin in WordPress, because it kept breaking the site (as skot suggested in this post). The strange thing is that I needed to keep my code tweak as well. Anyway, the integration worked fine.
__________________
Vasilis Vrontisis X-Cart Development, Maintenance & Customization https://[URL="http://www.craftforweb.com"]craftforweb.com[/url] vasilis@craftforweb.com |
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|