mintplugins / mp-isotopes

This plugin gives you a template tag which you can put on any archive page isotopes functionality
https://mintplugins.com/isotopes-for-wordpress/
10 stars 1 forks source link

Incompatible with WooCommerce 2.1.x #3

Closed epakrat closed 10 years ago

epakrat commented 10 years ago

No products are shown in Main (Archive) Shop Loop. Only tags bar are shown.

mintplugins commented 10 years ago

Hey, Are you using the latest version? (1.0.1.1)

epakrat commented 10 years ago

I just downloaded it from your site today. On Apr 9, 2014 5:57 PM, "moveplugins" notifications@github.com wrote:

Hey, Are you using the latest version? (1.0.1.1)

Reply to this email directly or view it on GitHubhttps://github.com/moveplugins/mp-isotopes/issues/3#issuecomment-40026677 .

mintplugins commented 10 years ago

You can see it in action here using WooCommerce 2.1.6:

http://demo.mintthemes.com/armonico/product-category/tshirts/

epakrat commented 10 years ago

Looks very nice! Thank you so much for your time! :-)

Can you send me a loop code snippet so I can try that? On Apr 9, 2014 6:21 PM, "moveplugins" notifications@github.com wrote:

You can see it in action here using WooCommerce 2.1.6:

http://demo.mintthemes.com/armonico/product-category/tshirts/

Reply to this email directly or view it on GitHubhttps://github.com/moveplugins/mp-isotopes/issues/3#issuecomment-40028166 .

epakrat commented 10 years ago

Took a look at your other plugins. Your restrict logins plugin is awesome! I think I'll get it to support you! On Apr 9, 2014 6:27 PM, "EPakrat" electronicpakrat@gmail.com wrote:

Looks very nice! Thank you so much for your time! :-)

Can you send me a loop code snippet so I can try that? On Apr 9, 2014 6:21 PM, "moveplugins" notifications@github.com wrote:

You can see it in action here using WooCommerce 2.1.6:

http://demo.mintthemes.com/armonico/product-category/tshirts/

Reply to this email directly or view it on GitHubhttps://github.com/moveplugins/mp-isotopes/issues/3#issuecomment-40028166 .

mintplugins commented 10 years ago

For sure! Place this code somewhere before you start "The Loop" in your archive file:

<?php if ( function_exists( 'mp_isotopes' ) ){ mp_isotopes(); }; ?>

"The Loop" (as mentioned above) usually looks something like this: <?php while ( have_posts() ) : the_post(); ?>

You can also see it in my theme called "knapstack". It's free to download here: https://moveplugins.com/downloads/knapstack-theme/

In that theme I use a hook which runs the isotope function before the loop. The code for it is located in the "includes/misc-functions/page-header-hooks.php" file on line 105.

It you have any trouble setting it up let me know.

Appreciate the support!

lightson commented 10 years ago

I have the same issue with woocommerce, the tag/filter bar shows fine, but no products display: http://spiritusvapes.staging.wpengine.com/shop/ (they show for a split second on pageload but then disappear). Everything else is set up as per instructions.

mintplugins commented 10 years ago

Hey there,

Your theme isn't using the WordPress standard post_class() on your product pages - which is required for this isotopes plugin to function.

For example, in the "woocommerce/content-product.php", it is missing.

Your article opens like this:

<article class="product span4 <?php
    if ( $woocommerce_loop['loop'] % $woocommerce_loop['columns'] == 0 )
        echo 'last';
    elseif ( ( $woocommerce_loop['loop'] - 1 ) % $woocommerce_loop['columns'] == 0 )
        echo 'first';
    ?>">

But it should look something more like this:

<?php
    //Your custom extra woocommerce class
    if ( $woocommerce_loop['loop'] % $woocommerce_loop['columns'] == 0 ){
        $yourcustomclass = 'last';
    }
    elseif ( ( $woocommerce_loop['loop'] - 1 ) % $woocommerce_loop['columns'] == 0 ){
        $yourcustomclass = 'first';
    }
    else{
        $yourcustomclass = NULL;    
    }

  $classes = array(
    'product',
    'span4',
    $yourcustomclass
  );
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>">