简体   繁体   中英

Jiggoshop product page messed up?

I have a Jigoshop installation on a theme and the product page is totally messed up however the product search page looks okay? You can view here: http://www.peterjswain.com/shop and then click on one of the products there.

I did have woocommerce installed which was worse before but they did have some documentation on hooks and replacing the loop in the theme files; I am unsure if there is a similar method with Jigoshop.

Any help would be greatly appreciated.

Thanks in advance. :)

I'd recommend that you create a jigoshop folder in your theme, and pull the archive-product.php from the plugin templates folder, and then you can edit that file to look like you want to.

Currently the shop uses the Wordpress archive page to output the shop, so you don't have any layout. It all depends on the theme you are using.

jigoshop is a bit different than woocommerce in that it's relying on hooks even more than woocommerce, and functions as well. Some functions you can't even rewrite, so you need to override the default template completely.

For instance, I'd create an archive-product.php file in jigoshop folder in your theme that looks like this

<?php
/**
 * Archive template
 *
 * DISCLAIMER
 *
 * Do not edit or add directly to this file if you wish to upgrade Jigoshop to newer
 * versions in the future. If you wish to customise Jigoshop core for your needs,
 * please use our GitHub repository to publish essential changes for consideration.
 *
 * @package             Jigoshop
 * @category            Catalog
 * @author              Jigoshop
 * @copyright           Copyright © 2011-2014 Jigoshop.
 * @license             GNU General Public License v3
 */
?>

<?php get_header(); ?>

<div class="container">
    <div class="row">
        <div class="twelve columns">
        <?php if (is_search()) : ?>
            <h1 class="page-title"><?php _e('Search Results:', 'jigoshop'); ?> &ldquo;<?php the_search_query(); ?>&rdquo; <?php if (get_query_var('paged')) echo ' &mdash; Page '.get_query_var('paged'); ?></h1>
        <?php endif; ?>

        <?php
            $shop_page_id = jigoshop_get_page_id('shop');
            $shop_page = get_post($shop_page_id);
            if(post_password_required($shop_page)):
                echo get_the_password_form($shop_page);
            else:
                //echo apply_filters('the_content', $shop_page->post_content);
        ?>

        <?php
        ob_start();
        jigoshop_get_template_part( 'loop', 'shop' );
        $products_list_html = ob_get_clean();
        echo apply_filters( 'jigoshop_products_list', $products_list_html );
        ?>

        <?php do_action('jigoshop_pagination'); ?>
        <?php endif; ?>
        </div>
        <div class="four columns">
            <?php dynamic_sidebar('shop sidebar');?>
        </div>
    </div>
    <!-- Clear -->
    <div class="clear bottom"></div>
</div>

<?php get_footer(); ?>

This should put everything in some kind of container, so that you'll have a uniform look on your page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM