DataTables & Woocommerce conflict on certain Wordpress installs/server setups? Strange behaviour!

DataTables & Woocommerce conflict on certain Wordpress installs/server setups? Strange behaviour!

musictechmusictech Posts: 2Questions: 0Answers: 0
edited June 2013 in Bug reports
I spent about 20 hours yesterday pulling what's left of my hair out trying to figure out why DataTables is not working on a live (shared) server.

Hoping some others who are patient enough to read this might have some ideas. jQuery & javascript are still fairly new to me, which is why I rely on plugins like DataTables.

I'm doing volunteer work for my son's school PTA web site, and have created some pretty extensive Wordpress plugins to add some custom functionality.

I created a Student Directory that pulls students out of the database and displays them in a big table list, with some custom links for each student that will then show parent contact info. They can filter the results by grade or teacher, which is all done with PHP/MySQL. All that works fine. The problem is when we implement this for the school, there will be close to 400 students in the database, which will make for a very long table list!

DataTables works perfectly for handling pagination and sorting of the results, and the live search box is great! Certainly not something I could code myself.

This works fine on my home computer running Windows 7 and xamp with latest PHP/MySql and all the various Wordpress plugins. However, when I upload everything to the shared server we'll be using for the site, DataTables doesn't work at all, and I just get plain html table output. I used the debugger and it shows I have the latest version of datatables on the page, but it shows 0 tables.

After lots of trial and error, I narrowed it down to the Woocommerce plugin that is causing some sort of conflict. With that turned off, it works fine. But, we need that, and it works just fine with Woocommerce on my development server at home. I even set up a test account on my own dedicated server (with the same hosting company) and installed everything there, and it worked just perfectly there! The only big difference I could see was that my dedicated server was using PHP 5.4.1 while the shared server was still using PHP 5.3. I managed to convince the hosting company to upgrade PHP on that shared server, but that still didn't fix the problem. I then totally wiped clean the account and reinstalled everything on the shared server, but still had the same issue. Wiped and reinstalled a second time using a different method. Still no luck.

Anybody experience anything like this? Have any ideas of where I should be looking for conflicts? Woocommerce is HUGE and loads a lot of scripts all over the place, but datatables and Woocommerce seem to co-exist peacefully on other server setups... it's just our shared server that seems to be giving me problems. If I turn off Woocommerce, it works fine, so there is nothing wrong with the way I set up DataTables.

Any help is greatly appreciated... my time on all of this is volunteer work for the non-profit school PTA.

Replies

  • musictechmusictech Posts: 2Questions: 0Answers: 0
    You can see the page where the table would be here:
    http://69.50.223.254/manage-students/student-directory/

    But, without an authorized account, the directory won't show, and datatables won't be loaded, you'll just get a message saying you don't have access. However, you can view the source of that page to see all the scripts that woocommerce is loading.

    If you think you can help, but need access, contact me privately and I'll set up a test account with the appropriate access.
  • allanallan Posts: 56,444Questions: 1Answers: 8,957 Site admin
    I don't see DataTables being included in the non-logged in page, so I'm not sure that there is much help I can offer without being able to actually see the problem I'm afraid.

    Allan
This discussion has been closed.