You might look at the WordPress database API at https://codex.wordpress.org/Class_Reference/wpdb to help you code your searches and use WP to access that 2nd database.
child theme or plugin?
Usually I would say plugin so that themes can be freely swapped without affecting functionality. However, if you will be needing custom templates, you really need a child theme. Parent themes can still be swapped, but the child needs to be adjusted accordingly. It’s possible to do templates from plugins, but it gets messy.
For the most part, you can accomplish anything in a child theme that would normally be done by plugin. Doing plugin type things in a theme is usually frowned upon, but for one off custom code specific to a site, the distinction is often blurred.
If you haven’t already done so, get acquainted with how WP action and filter hooks work. Use these instead of altered template code anytime you can. WooCommerce provides for them extensively. The other chapters of the linked Plugin Handbook has tons of WP specific development information.. It’s a good reference to be acquainted with.
IF I understood this correctly… you want to add an extra database to the search results on the WooCommerce database?
If it is a one time deal, maybe just try to export and import the other data into the WooCommerce database?
Thread Starter
jcagui
(@jcagui)
Thank you for your quick answers, I will focus on your suggestions so I don’t get lost!
it’s for a site selling print cartridges, and I need a many to many relationship because a cartridge can be used in several printers and a printer can use many differents cartridge (originales, compatibles..).
We have bougth a database witch do the job, so I have the solution of using it next to the WP database : in that case I inject all the cartridges and the printers in the post table for the business in woocommerce but I use it for the data search, or the solution of creating a new table in wp databases witch do the job (distributes the data..), but the first database is prefect so I’d like to try to deal with it!?
At the moment this is what we have done (export and import), but I am worried that it does not work well in terms of classifications, searching and displaying results.
thank you very much for your support