如何修改Jigoshop的产品页面

时间:2013-04-22 作者:SamKit

嗨,我正在编辑Jigoshop loop shop。php创建自定义外观列表,代码如下。。。。请一定要让我知道我可以在哪里得到下面的东西。。。

添加到购物车-仅链接-价格文本-列表项目和产品说明enter image description here

下面是我的loop shop代码。php

<?php
global $columns, $per_page;
do_action(\'jigoshop_before_shop_loop\');
$loop = 0;
if (!isset($columns) || !$columns) $columns = apply_filters(\'loop_shop_columns\', 4);
//if (!isset($per_page) || !$per_page) $per_page = apply_filters(\'loop_shop_per_page\', get_option(\'posts_per_page\'));
//if ($per_page > get_option(\'posts_per_page\')) query_posts( array_merge( $wp_query->query, array( \'posts_per_page\' => $per_page ) ) );
ob_start();
if (have_posts()) : while (have_posts()) : the_post(); $_product = new jigoshop_product( $post->ID ); $loop++;

?>

<div class="row show-grid">
  <div class="span12" class="custom-product" id="custom-product">
  <?php do_action(\'jigoshop_before_shop_loop_item\'); ?>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td rowspan="2"><?php do_action(\'jigoshop_before_shop_loop_item_title\', $post, $_product); ?></td>
      <td colspan="3" align="left" valign="top"><h2><strong><a href="<?php the_permalink(); ?>">
          <?php the_title(); ?>
          </a></strong></h2>
        <p><strong></strong> </p></td>
    </tr>
    <tr>
      <td align="left" valign="middle"><div class="euro-button"><strong> </strong></div></td>
      <td align="center" valign="middle"><a href="#"><img src="<?php bloginfo(\'template_directory\'); ?>/img/add-tocart-button.png" alt="Add to Cart"></a></td>
      <td align="right" valign="middle"><a href="<?php the_permalink(); ?>"><img src="<?php bloginfo(\'template_directory\'); ?>/img/product-description.png" alt="Product Information"> </a></td>
    </tr>
  </table>
</div>
</div>
<br/>
<?php

    if ($loop==$per_page) break;
        endwhile; endif;

    if ($loop==0) :
        $content = \'<p class="info">\'.__(\'No products found which match your selection.\', \'jigoshop\').\'</p>\';
        else :
            $found_posts = ob_get_clean();
            $content = \'<ul class="products">\' . $found_posts . \'</ul><div class="clear"></div>\';
        endif;

        echo apply_filters( \'jigoshop_loop_shop_content\', $content );

    do_action(\'jigoshop_after_shop_loop\');

1 个回复
SO网友:Krishna Consciousness

您需要编辑循环商店。模板下的php文件(请记住,文件可以自动更新,因此需要备份。)

    <?php
    global $columns, $per_page;
    do_action(\'jigoshop_before_shop_loop\');
    $loop = 0;
    if (!isset($columns) || !$columns) $columns = apply_filters(\'loop_shop_columns\', 4);
    //if (!isset($per_page) || !$per_page) $per_page = apply_filters(\'loop_shop_per_page\', get_option(\'posts_per_page\'));
    //if ($per_page > get_option(\'posts_per_page\')) query_posts( array_merge( $wp_query->query, array( \'posts_per_page\' => $per_page ) ) );
    ob_start();
    if (have_posts()) : while (have_posts()) : the_post(); $_product = new jigoshop_product( $post->ID ); $loop++;

    ?>

    <div class="row show-grid">
      <div class="span12" class="custom-product" id="custom-product">
      <?php do_action(\'jigoshop_before_shop_loop_item\'); ?>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td rowspan="2" width="185"><?php do_action(\'jigoshop_before_shop_loop_item_title\', $post, $_product); ?></td>
          <td colspan="3" align="left" valign="top"><h2><strong><a href="<?php the_permalink(); ?>">
              <?php the_title(); ?>
              </a></strong></h2>
            <p><?php do_action(\'jigoshop_before_shop_loop_product_summary\', $post, $_product ); ?></p></td>
        </tr>
        <tr>
          <td align="left" valign="bottom"><div id="btnPrice"><?php do_action(\'jigoshop_after_shop_loop_item_title\', $post, $_product); ?></div></td>
          <td align="center" valign="bottom"><div id="btnCart"><?php do_action(\'jigoshop_after_shop_loop_item\', $post, $_product); ?></div></td>
          <td align="right" valign="bottom"><a href="<?php the_permalink(); ?>"><img src="<?php bloginfo(\'template_directory\'); ?>/img/product-description.png" alt="Product Information"> </a></td>
        </tr>
      </table>
    </div>
    </div>
    <br/>
    <?php

        if ($loop==$per_page) break;
            endwhile; endif;

        if ($loop==0) :
            $content = \'<p class="info">\'.__(\'No products found which match your selection.\', \'jigoshop\').\'</p>\';
            else :
                $found_posts = ob_get_clean();
                $content = \'<ul class="products">\' . $found_posts . \'</ul><div class="clear"></div>\';
            endif;

            echo apply_filters( \'jigoshop_loop_shop_content\', $content );

        do_action(\'jigoshop_after_shop_loop\');
您需要根据需要添加一些CSS来美化

#btnPrice {
    background: url("../img/euro.png") no-repeat scroll 0 0 transparent;
    height: 45px !important;
    line-height: 13px;
    padding: 10px 0 0 !important;
    text-align: center;
    width: 202px !important;
    margin-right:10px;
}
#btnPrice  .price {
    magrin:0 !important;
    line-height:30px !important;
    font-family:Arial !important;
    font-size:20pt !important;
    color:#FFF !important;

}

#btnCart .button {
    background: url("../img/add-tocart-button.png") no-repeat scroll 0 0 transparent;
    font-family: Arial !important;
    font-size: 15pt !important;
    height: 45px !important;
    line-height: 45px !important;
    padding: 0 0 10px !important;
    width: 202px !important;
}
现在您已经完成了,还可以添加一些操作来停止每次更新word press。

停止更新Wordpress

add_filter( \'http_request_args\', \'dm_prevent_update_check\', 10, 2 );
function dm_prevent_update_check( $r, $url ) {
    if ( 0 === strpos( $url, \'http://api.wordpress.org/plugins/update-check/\' ) ) {
        $my_plugin = plugin_basename( __FILE__ );
        $plugins = unserialize( $r[\'body\'][\'plugins\'] );
        unset( $plugins->plugins[$my_plugin] );
        unset( $plugins->active[array_search( $my_plugin, $plugins->active )] );
        $r[\'body\'][\'plugins\'] = serialize( $plugins );
    }
    return $r;
}
// stop updating wordpress plugins

结束

相关推荐

与Jigoshop一起在页面上显示产品SKU

我正在使用Jigoshop plugin (目前一切进展顺利!)并且需要在页面上显示产品SKU,有人知道怎么做吗?p、 我会在Jigoshop论坛上询问,但你必须为此付费。