1

Hi I am editing Jigoshop loop-shop.php to create a customize look list and the code is below .... Please do let me know where I can get below things ...

  1. Add to Cart - Link Only
  2. Price Text - List item
  3. and Product Description

enter image description here

Below is my code of 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 Answer 1

1

You need to edit the loop-shop.php file under template (remember the file can be auto updated, so you need a backup.)

    <?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');

You need to add some CSS to beautifying as per your requirement

#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;
}

Now you have done, you can also add some action to stop updating word-press each time.

Stop updating 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.