integrating WooCommerce
Hi,
I'm using Gridalicious Pro and am in the process of integrating Woocommerce. Both theme and plugin are the latest versions.
This theme is not yet compatible with Woocommerce (although according to this post here: https://catchthemes.com/support-forum/topic/woocommerce-integration/#post-58285
the implementation was supposed to go live over a year ago.
Any clue when it will really go live? I hope soon as that'll solve my problems! :)
WooCommerce provided the coding to add to the functions.php (for me the one of the child-theme I'm using). Reference:
https://docs.woocommerce.com/document/third-party-custom-theme-compatibility/
I'd like to use the method using hooks, and it tells me to check the page.php of my theme for the correct markup. Found the page.php, but unfortuntaly, I really can't figure out what the exact coding should be.
Page.php in Gridalicious Pro is:
<?php
/**
* The template for displaying all pages
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package Catch Themes
* @subpackage Gridalicious
* @since Gridalicious 1.0
*/
get_header(); ?>
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php
/**
* gridalicious_comment_section hook
*
* @hooked gridalicious_get_comment_section - 10
*/
do_action( 'gridalicious_comment_section' );
?>
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Hook code to use, according to Woocommerce, is this:
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10);
add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10);
function my_theme_wrapper_start() {
echo '<section id="main">';
}
function my_theme_wrapper_end() {
echo '</section>';
}
This should make the woocommerce pages use the layout etc. of the theme used.
I understand that the part "my_theme" in the code should probably be replaced by "gridalicious" (not totally certain though), but even then it's still only part of the coding apparently and for the life of me I can't figure what the full code should be. I've tried a few things (least of all adding of course <?php en ?> tags), but nothing appears to work and I really don't want to break anything!
So my question is:
What exactly do I put in the functions.php om my (child) theme so Woocommerce will be integrated flawlessly into the Gridalicious theme?
thanks for your help!
Henriët