• Resolved omeld

    (@omeld)


    Some time ago, I’ve built a custom theme for a WordPress site. What is the best way of converting it for use with WooCommerce?

    For testing purposes, I’ve converted my custom post types to products and added support for custom meta fields and taxonomies. Basically, I’m trying to replicate the established behavior, so everything that used to belong to, e.g., the custom post type “books” will now be products. So far, this works as expected.

    I’ve added WooCommerce support to my functions.php. I’ve copied all template files to a subfolder.

    What’s the best way to proceed? I can overwrite the single-product template with my previous custom single-post_type template, and it basically works, without any WooCommerce functionality, of course. Would it make sense to go from here and add functionality to my previous templates (e.g., add functions to display the price) or, rather, edit WooCommerce templates to make them look and behave like my previous templates?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there @omeld 👋

    rather, edit WooCommerce templates to make them look and behave like my previous templates?

    Depending on the end-goal, that option seems to strike a better balance between development time and results.

    Additionally, consider building a child theme of Storefront (or converting your theme to a Storefront child theme, shall I say), as this will ensure bulletproof WooCommerce integration and there’s a wealth of WooCommerce Storefront documentation available at the WooCommerce documentation site.

    I hope that points you to the right direction!

    Thread Starter omeld

    (@omeld)

    Hi @anastas10s!

    Thanks for your reply. The site (www.ludliteratura.si) is quite complex so it wouldn’t be possible to change the theme globally as there are many templates unrelated to the store. If I understand correctly, I can’t use a separate theme for the store (multisite might work for that but I don’t think it’s currently an option).

    So how should I go about editing the templates? I mean, how do I edit the actual html layout?

    But in general, if I wanted to add WooCommerce functionality to my theme, where do I find documentation regarding the functions to use? For example, since I already have working “product” templates, if I only wanted to test availability, display prices and add an add to cart button? For the cart and checkout pages, I’ll gladly start with the default templates, since these would be new additions anyway …

    Saif

    (@babylon1999)

    Hello @omeld,

    But in general, if I wanted to add WooCommerce functionality to my theme, where do I find documentation regarding the functions to use?

    You can check the WooCommerce Theme Developer Handbook here. If you need more help with this, then I recommend checking the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    Hope it helps!

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

The topic ‘Convert WordPress theme for use with WooCommerce’ is closed to new replies.