Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Woocommerce template overrides #718

Closed
msacchetti opened this issue Feb 9, 2016 · 2 comments
Closed

Woocommerce template overrides #718

msacchetti opened this issue Feb 9, 2016 · 2 comments

Comments

@msacchetti
Copy link

#651

Piggybacking off 651, which seems to not be solved.

woocommerce.php in the root does not allow you to override woocommerce templates in your theme (as intended by woothemes). I need to do this, so i removed woocommerce.php from the root. Once i do that, i can now override woocommerce templates as intended.

But then the theme throws this error on before_content and after_content. Do we need to include these functions in our woocommerce template over-rides possibly? How do we solve this?

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'foundationpress_before_content' not found or invalid function name in /home/content/00/9607100/html/newwordpress/wp-includes/plugin.php on line 525

@msacchetti
Copy link
Author

Solved: @olefredrik I think this needs to be done...otherwise using this template is not actually compatible with woocommerce. replace lines 251+ on cleanup.php. @eccola

If anyone can figure out a more dynamic way to fix this please share!

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 '<div id="page"><article class="main-content">';
}

function my_theme_wrapper_end() {

  echo '</article>';
  get_sidebar();
  echo '</div>';
}

@LC43
Copy link

LC43 commented Aug 6, 2016

I just added:

function foundationpress_before_content( $a ){

}

function foundationpress_after_content( $a ){

}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants