duandu8707 2015-10-19 05:04
浏览 16

Jiggoshop产品页搞砸了?

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. :)

  • 写回答

1条回答 默认 最新

  • douxi4287 2015-10-19 06:40
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计