• Hello,

    I’m new in wordpress and woocommerce development, I just need to make two databases cohexist, the wordpress (woocommerce) one, and a specific existing business database that meets the business need.
    The business database is already assembled and complete (purchased), I just need to create a custom search on this database and display the result of the search, the rest will be managed natively with woocommerce..
    could you give me some advices on this development?
    I manage very well the sql and the business base, for the php I can manage with my books, and as for wordpress I started to do some tests (child theme or plugin?) with search.php and wpdb connections but I drown myself…

    Sorry for the lack of precision, I’m a developer but completely new to wordpress and php, I need some guidance to save time.
    In advance thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    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.

    Moderator bcworkz

    (@bcworkz)

    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

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘woocommerce with new database’ is closed to new replies.