New MarketPress product filter

Hi,

I’m trying to implement the new product filter on MarketPress but I have a customised product list and am unsure what code to use to call it (and where it needs to go!)

Any help very gratefully received.

Thanks!

  • aecnu
    • WP Unicorn

    Greetings sequin,

    Sorry to see that your WordPress installation is having an issue with the latest release of the Market Press plugin.

    Please post a URL so that we can take a look at the current source code.

    In addition, any chance you can give us an idea what was custom coded? What is customized about the product list if you recall?

    Please advise.

    Cheers, Joe

  • sequin
    • Site Builder, Child of Zeus

    It’s been a while since I looked at the code, From memory I had to rework the layout from scratch as I couldn’t get the layout I wanted. This is the code from my mp_productlist file:

    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
    <!--Start side content-->
    <div class="side_content" style="margin-top:0px; margin-bottom:0px; padding-top:10px">
    <!--Start Post-->
    <div class="post" style="padding-left:5px; padding-right:5px; padding-top:2px; padding-bottom:0px; min-height:0px">
    <table style="border:none; padding:5; ">
    <tr><td style="border:none; cellpadding:0px; padding:0px"; rowspan="3">
    <?php $external = get_post_meta($post->ID, 'mp_product_link', true); ?>
    <?php if(!empty($external)): ?>
    <a rel="nofollow" target=”_blank” href="<?php echo $external ?>"><img src="<?php
    $imgsrc = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "Full");
    echo $imgsrc[0];
    ?>" alt="<?php the_title(); ?>" width="100" style="box-shadow:3px 3px 4px rgb(204, 204, 204); margin-right:15px; border:1px solid rgb(238, 238, 238); float:left;" /></a>
    <?php else : ?>
    <a href="<?php echo the_permalink() ?>" title="<?php the_title(); ?>"
    <?php mp_product_image() ?></a>
    <?php endif; ?>
    <?php $id = get_post_thumbnail_id(get_the_ID()); // gets the post thumbnail ID ?>
    </div></td>
    <td style="max-height:16px; border:none"; padding="5";>
    <h1 style="font-size: 13px; line-height:15px;">
    <?php $retailers_as_text = get_the_term_list( $post->ID, 'retailers', '', ', ', '' ) ; ?>
    <?php if(!empty($external)): ?>
    <a rel="nofollow" target=”_blank” href="<?php echo $external ?>"><?php the_title(); ?> (<?php echo strip_tags($retailers_as_text); ?>)</a></h1>
    </td>
    <td style="max-height:16px; border:none; float:right; v-align:top;">
    <font style="font-family:'Droid Serif',serif; font-size: 13px; line-height:15px;">
    <span style="line-height:15px">
    <?php echo mp_product_price(false, $post->ID, ''); ?></span>
    <?php else : ?>
    <a href="<?php the_permalink() ?>"><?php the_title(); ?> (<?php echo strip_tags($retailers_as_text); ?>)</a></h1>
    </td>
    <td style="max-height:16px; border:none; float:right; v-align:top;">
    <font style="font-family:'Droid Serif',serif; font-size: 13px; line-height:15px;">
    <span style="line-height:15px">
    <?php echo ct_MCPrice_text_b9c9(false, $post->ID, ''); ?></span>
    <?php endif; ?>
    </td></tr>
    <tr><td style="border:none"; cellpadding="5"; padding="5"; colspan="2";><?php the_content(); ?></td></tr>
    <?php $offers = get_post_meta($post->ID, '_ct_textarea_4fa3ab8527539', true) ?>
    <?php if(!empty($offers)): ?>
    <tr><td style="colspan:2; border:1px solid #158d81; text-align:justify;">
    <font style="font-color:#622659"><i><?php echo do_shortcode('[ct id="_ct_textarea_4fa3ab8527539" property="title | description | value"]'); ?></i></body></td>
    </tr>
    <?php else : ?>
    <tr><td style="border:none; colspan:2;"></td></tr>
    <?php endif; ?>
    </table>
    </div>
    <div class="shadow"style="height:10px; margin-top:-1px; margin-bottom:0px;"> </div>
    <!--End Post-->

    I don’t know whether I will be able to call the product filter within this or whether I will need to start again?

  • aecnu
    • WP Unicorn

    Greetings Mel,

    Thank you for posting your code and the files from your custom coding may indeed be lost during the upgrade/update.

    Regarding the coding above and your direct question:

    I don’t know whether I will be able to call the product filter within this or whether I will need to start again?

    I will see if I can get the lead developer in here with his invaluable insight into this plugin for his advice/advise for us.

    Though this may take a bit longer then a normal ticket, I will try to get him in here asap.

    Cheers, Joe

  • Aaron
    • CTO

    Because you are using a custom loop the ajax live filter will not be able to be used. It relies on the same wrapper id as the default product list output, and will dynamically replace it with the default product list output on filter changes.

    So you would have to either code your own version of the filter and ajax handler, or stop using a custom loop.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.