• SoulOnFire

    (@soulonfire)


    Hi,

    I am working on a WordPress theme based on Foundation. I have installed WooCommerce, however, I have a problem with the shop page and Foundation off-canvas menu.

    The problem is that the content for the page has to be loaded within the tags:
    <div class="off-canvas-content" data-off-canvas-content></div>
    If use load_template() to load the shop page, it works but woocommerce loads it again after that.

    if (is_shop()) {
      $woo_file = 'archive-product.php';
    }
    $template = WC()->plugin_path() . '/templates/'. $woo_file;
    load_template( $template, false );

    I’ve tried adding the wrapping tags to the wrapper-start.php and wrapper-end.php templates but it’s not working.

    I can’t seem to find a way to prevent WooCommerce from automatically loading the archive template after I call it within the offcanvas content tags. Any help is appreciated. Thanks

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Have a look at the source code for archive-product.php. It has a slew of hooks you can use to output div tags at various spots. If that’s not enough, you can override the entire template by copying it to your theme as explained in the template’s header comment.

    archive-product.php is responsible for the entire front page output, completely replacing the usual theme page template. The right spots for the div tags surely lie on this page somewhere. Work with it, don’t try to stop it – that’ll just cause more problems.

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with WooCommerce and Foundation off-canvas menu’ is closed to new replies.